When the layer of epidemiological units lacks CRS information (missing .prj in the original shapefile), the analysis work as expected except for the final risk map by epidemiological unit, which is not shown.
I could not reproduce locally exactly. I always see an error message. But I believe it to have the same root cause.
MRE:
library(mapMCDA)
library(raster)
#> Loading required package: sp
r <- raster(nrow = 10, ncol = 10)
r[] <- seq.int(ncell(r))
epiunits <- as(r, "SpatialPolygons")
proj4string(epiunits) <- CRS()
risk_unit(r, epiunits)
#> Error in over(eu, rgrid, fn = fun): identicalCRS(x, y) is not TRUE
When the layer of epidemiological units lacks CRS information (missing .prj in the original shapefile), the analysis work as expected except for the final risk map by epidemiological unit, which is not shown.
I could not reproduce locally exactly. I always see an error message. But I believe it to have the same root cause.
MRE:
Created on 2019-04-11 by the reprex package (v0.2.1)