Error when factors and epidemiological units have different CRS
MRE:
library(mapMCDA)
cmr <- mapMCDA_datasets()
rr <- cmr$animal.density # WGS84
bb <- st_transform(cmr$cmr_admin3, crs = "EPSG:32632") # UTM 32N
#> Error in st_transform(cmr$cmr_admin3, crs = "EPSG:32632"): could not find function "st_transform"
res <- risk_layer(rr, boundaries = bb)
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'mask': error in evaluating the argument 'x' in selecting a method for function 'extend': object 'bb' not found
Created on 2024-05-28 with reprex v2.1.0