diff --git a/DESCRIPTION b/DESCRIPTION index 953c87d..530ab21 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -3,7 +3,7 @@ Type: Package Title: Utilities for Working With the 'fireSense' Group of 'SpaDES' Modules Description: Utilities for working with the 'fireSense' group of 'SpaDES' modules. Date: 2023-10-13 -Version: 0.0.5.9052 +Version: 0.0.5.9053 Authors@R: c( person("Jean", "Marchal", email = "jean.d.marchal@gmail.com", role = c("aut")), diff --git a/R/makeLociList.R b/R/makeLociList.R index 3846c44..0e4a5f6 100644 --- a/R/makeLociList.R +++ b/R/makeLociList.R @@ -53,6 +53,11 @@ makeLociList <- function(ras, pts, idsCol = "FIRE_ID", dateCol = "YEAR", sizeCol "m2" = 1, stop("Must provide sizeColUnits either ha or m2") ) + #Check if loci sizes are numeric, otherwise the rescaling fails + if (!inherits(x = lociDF$size, what = "numeric")){ + warning(paste0("Fire sizes were classified as ", class(lociDF$size),". Converting to numeric.")) + lociDF[, size := as.numeric(size)] + } set(lociDF, NULL, "size", round(lociDF$size / (prod(res(ras)) / divisor), 0)) for (index in colnames(lociDF)) {