- regions
The region breakdown for the map, can be one of
("states"
, "state"
, "counties"
, "county"
).
The default is "states"
.
- include
The regions to include in the resulting map. If regions
is
"states"
/"state"
, the value can be either a state name, abbreviation or FIPS code.
For counties, the FIPS must be provided as there can be multiple counties with the
same name. If states are provided in the county map, only counties in the included states
will be returned.
- exclude
The regions to exclude in the resulting map. If regions
is
"states"
/"state"
, the value can be either a state name, abbreviation or FIPS code.
For counties, the FIPS must be provided as there can be multiple counties with the
same name. The regions listed in the include
parameter take precedence over
regions listed in exclude
. If both parameters include the same region(s) they
will be included in the map.
- data
A data frame containing values to plot on the map. This
parameter should be a data frame consisting of two columns,
a FIPS code (2 characters for state, 5 characters for county)
and the value that should be associated with that region. The
columns of data
must be fips
or state
and
the value of the values
parameter.
- values
The name of the column that contains the values to be associated
with a given region. The default is "value"
.
- theme
The theme that should be used for plotting the map. The default
is theme_map
from ggthemes.
- labels
Whether or not to display labels on the map. Labels are not displayed
by default.
- label_color
The color of the labels to display. Corresponds to the color
option in the ggplot2::aes()
mapping. The default is "black"
.
Click here
for more color options.
- data_year
The year for which to obtain map data.
If the value is NULL
, the most recent year's data is used. If the
provided year is not found from the available map data sets, the next most
recent year's data is used. This can be used if an older data set is being
plotted on the US map so that the data matches the map more accurately.
Therefore, the provided value should match the year of the plotted data set.
The default is NULL
, i.e. the most recent available year is used.
- ...
Other arguments to pass to ggplot2::aes()
. These are
often aesthetics, used to set an aesthetic to a fixed value, like color = "red"
or linewidth = 3
. They affect the appearance of the polygons used to render
the map (for example fill color, line color, line thickness, etc.). If any of
color
/colour
, fill
, or linewidth
are not specified they
are set to their default values of color="black"
, fill="white"
,
and linewidth=0.4
.