Commit e5903ff7 authored by Facundo Muñoz's avatar Facundo Muñoz ®️
Browse files

risk_layer(): improve err msg for constant values

parent 744828c3
......@@ -38,8 +38,7 @@ risk_layer <- function(x, boundaries, scale_target = c(0, 100)) {
scale_source <- range(raster::values(r), na.rm = TRUE)
if (isTRUE(all.equal(diff(scale_source), 0))) {
stop("Risk factor ", substitute(x),
" has a constant value and cannot be used as it is.\n",
stop("This risk factor has a constant value and cannot be rescaled.\n",
"Please correct or remove.")
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment