hexplot: Hexagonal cartogram of the US by state

Description Usage Arguments Value Examples

View source: R/hexplot.R

Description

Add fill colour to a hexgonal cartogram of the US

Usage

1
hexplot(states, fill, label = TRUE, labelcolor = "grey90")

Arguments

states

vector of state names

fill

vector mapping to fill color, same order as states

label

logical. Should labels be shown?

labelcolor

colour in which labels are shown. Ignored if 'label=FALSE'.

Value

ggplot2 object

Examples

1
2
3
4
data(elections)
el12 <- elections %>% dplyr::filter(year == 2012)
hexplot(el12$state, el12$perc_rep > el12$perc_dem) +
  scale_fill_party("Election 2012", labels=c("Democrat", "Republican"))

heike/electionViz documentation built on Nov. 16, 2020, 10:02 p.m.