map_elections: Map elections data

Description Usage Arguments Examples

Description

Map elections data

Usage

1
2
3
map_counties(data, congress = NULL, projection = NULL,
  congressional_boundaries = TRUE, state_boundaries = FALSE,
  cities = 4L, state = NULL, width = "100%", height = "600px")

Arguments

data

An sf object with elections data returned by join_to_spatial.

congress

The number of the Congress. If NULL, it will be guessed from the data.

projection

If not provided, then the best state plane projection will be guessed using the state_plane function from the USAboundaries package. If NULL, then leaflet's default Web Mercator projection will be used. To use a custom projection, provide a projection/CRS object returned by the leafletCRS function in the leaflet package.

congressional_boundaries

Draw Congressional district boundaries in addition to county boundaries?

state_boundaries

Draw state boundaries in addition to county boundaries?

cities

Number of largest cities to draw. Pass FALSE to not draw any cities.

state

Override the guessing of the state from the data passed in.

width

The width of the map in pixels or percentage. Passed on to leaflet.

height

The height of the map in pixels or percentage. Passed on to leaflet.

Examples

1
2
map_data <- get_county_map_data("meae.congressional.congress19.nc.county")
map_counties(map_data)

mapping-elections/mappingelections documentation built on July 24, 2019, 9:42 a.m.