wafflemap: Waffle Map

Description Usage Arguments Value Examples

Description

Plot a waffle map.

Usage

1
wafflemap(x, var, ncol, size, ...)

Arguments

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.

Value

An sf object of polygons is returned.

Examples

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))

rCarto/wafflemap documentation built on May 29, 2019, 2:54 p.m.