Skip to content

Commit

Permalink
fix: check for numerical metric
Browse files Browse the repository at this point in the history
  • Loading branch information
ahasverus committed Apr 30, 2024
1 parent 73fa467 commit d1c2b7e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions R/ggmap_marine.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ ggmap_marine <- function(data, metric, title = NULL,

error_if_field_not_in_df(data, metric)

if (!is.numeric(data[ , metric, drop = TRUE])) {
stop("The column '", metric, "' in 'data' must be `numeric`",
call. = FALSE)
}

if (!is.null(title)) {
error_if_not_character(title)
error_if_not_length_of(title, 1)
Expand Down

0 comments on commit d1c2b7e

Please sign in to comment.