Bug on waffleLayer
dieghernan opened this issue · 0 comments
dieghernan commented
There is a small bug on waffleLayer
due to use naming of 'X','Y'
coordinates
Lines 137 to 138 in af37610
If the dataset x
has any variable already named like that the layer uses that value instead the centroids. See here:
library(sf)
library(cartography)
mtq <- st_read(system.file("gpkg/mtq.gpkg", package = "cartography"),
quiet = TRUE)
# number of employed persons
mtq$EMP <- mtq$ACT - mtq$CHOM
#mtq$X <- 700000
mtq$Y <- 1620000
par(mar=c(2,2,2,2))
plot(st_geometry(mtq), axes=TRUE)
waffleLayer(
x = mtq,
var = c("EMP", "CHOM"),
cellvalue = 100,
cellsize = 400,
add=TRUE
)
I prepared a small PR. Regards