Closed dieghernan closed 4 years ago
There is a small bug on waffleLayerdue to use naming of 'X','Y' coordinates https://github.com/riatelab/cartography/blob/af37610ee6a6c1c5b9bb3ba31aec7013762f6af2/R/waffleLayer.R#L137-L138
waffleLayer
'X','Y'
If the dataset x has any variable already named like that the layer uses that value instead the centroids. See here:
x
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
There is a small bug on
waffleLayer
due to use naming of'X','Y'
coordinates https://github.com/riatelab/cartography/blob/af37610ee6a6c1c5b9bb3ba31aec7013762f6af2/R/waffleLayer.R#L137-L138If the dataset
x
has any variable already named like that the layer uses that value instead the centroids. See here:I prepared a small PR. Regards