map_coloring {ggredist} | R Documentation |
Produce a Map Coloring
Description
Finds colors for every element of a shapefile so that adjacent elements don't have the same color.
Usage
map_coloring(shp, min_coloring = TRUE)
Arguments
shp |
an |
min_coloring |
if |
Value
an integer vector of the same length as shp
, corresponding to the
coloring.
Examples
data(oregon)
or_short = oregon[30:50, ]
map_coloring(or_short)
library(ggplot2)
ggplot(or_short, aes(fill = map_coloring(or_short))) +
geom_sf() +
theme_map()
[Package ggredist version 0.0.2 Index]