Description Usage Arguments Value Examples
Plot a waffle map.
1 |
x |
either an sf object or a data.frame with coordinates fields named "X" and "Y". |
var |
names of the field to use in x. |
ncol |
number of columns. |
size |
size of a cell side. |
... |
other arguments from cartography::typoLayer. |
An sf object of polygons is returned.
1 2 3 4 5 6 7 | library(wafflemap)
library(cartography)
data(bond)
plot(st_geometry(bond[bond$ISO2 %in% c("IS", "TR"), ]), bg = "ivory3", border = NA)
plot(bond$geometry, border = "ivory2", bg = "ivory3", col = "ivory1", add=TRUE)
wafflemap(x = bond, var = c("Sean.Connery", "Roger.Moore", "Pierce.Brosnan", "Daniel.Craig"),
ncol = 3, size = 100000, add=TRUE, col = carto.pal(pal1 = "multi.pal", n1 = 4))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.