diff --git a/R/colors.R b/R/colors.R index 4767a59ea..5c14603ec 100644 --- a/R/colors.R +++ b/R/colors.R @@ -112,6 +112,8 @@ colorBin <- function(palette, domain, bins = 7, pretty = TRUE, # breaks are specified if (missing(domain) && length(bins) > 1) { domain = NULL + } else if (!( table(is.finite(domain))["TRUE"] > 1 )) { + stop ("'Domain' must contain at least 2 finite values!") } autobin = is.null(domain) && length(bins) == 1 if (!is.null(domain))