diff --git a/NEWS.md b/NEWS.md index 70f698d6..7b212061 100644 --- a/NEWS.md +++ b/NEWS.md @@ -6,6 +6,8 @@ `enhanced` - Sampling Vignette - Added content about `sample_existing()` +`fixed` - `strat_map()` - Fixed improper use of `terra::hasValues`. From Robert Hijmans #31 + # sgsR 1.4.1 `fixed` - `sample_ahels()` - gave an erroneous error when `matrices` was provided and `nQuant` did not match. Changed to allow only `matrices` to be provided. diff --git a/R/strat_map.R b/R/strat_map.R index 7a86c62a..35bf7ecb 100644 --- a/R/strat_map.R +++ b/R/strat_map.R @@ -116,7 +116,7 @@ strat_map <- function(sraster, } #--- error handling for raster inputs ---# - if (isFALSE(sraster@ptr$hasValues)) { + if (isFALSE(terra::hasValues(sraster))) { stop("'sraster' has no values.", call. = FALSE) }