This is a quick way to create a choropleth sketch of town-, neighborhood-, or tract-level data. Uses a corresponding sf object; as of June 2018, this sf object must be one that ships with this package, or otherwise be globally available.

quick_map(
  data,
  name = name,
  value = value,
  level = c("town", "neighborhood", "tract"),
  city = NULL,
  n = 5,
  palette = "GnBu",
  title = NULL,
  ...
)

Arguments

data

A data frame containing data by geography.

name

Bare column name of location names to join; defaults name.

value

Bare column name of numeric values to map; defaults value.

level

String giving the desired geographic level; must be one of "town", "neighborhood", or "tract". Defaults "town".

city

If geographic level is neighborhood, string of the corresponding city name to match to a spatial object.

n

Number of breaks into which to bin values; defaults (approximately) 5.

palette

String of a ColorBrewer palette; see RColorBrewer::RColorBrewer() for possible values. Defaults "GnBu".

title

String giving the title, if desired, for the plot.

...

Any other parameters to pass along to geom_sf(), such as color or size.

Value

A ggplot

Examples

if (FALSE) {
tidycensus::get_acs(geography = "county subdivision",
       variables = c(median_age = "B01002_001"), state = "09", county = "009") |>
  town_names(NAME) |>
  dplyr::filter(NAME %in% regions$`Greater New Haven`) |>
  quick_map(name = NAME, value = estimate, title = "Median age by town, 2017", n = 6)
}