plot_choro: Plot a Choropleth

Description Usage Arguments Examples

Description

This function takes a dataframe and generates a choropleth plot

Usage

1
2
plot_choro(df, fill, map = c("county", "state"), palette = "Blues",
  cuts = NULL, continental = TRUE)

Arguments

df

The dataframe with column "fips" (the FIPS code of the counties or states to show), with a column for the data to show

fill

The name of the variable to show in the choropleth

map

The level at which to draw the map. Options are "county", "state"

palette

An RColorBrewer palette to use. Default is "Blues"

cuts

An optional vector specifying where to make the color breaks Default cuts are the 20th, 40th, 60th, and 80th percentiles

continental

A logical whether to show the continental US

Examples

1
2
3
4
data(population_age, package = "noncensus")
df <- plyr::ddply(population_age, "fips", summarize, population = sum(population))
plot_choro(df, fill = "population", map = "county", palette = "Purples",
continental = TRUE)

ramhiser/noncensus documentation built on May 26, 2019, 10:11 p.m.