| us_map | R Documentation | 
Retrieve US map data
us_map(
  regions = c("states", "state", "counties", "county"),
  include = c(),
  exclude = c(),
  as_sf = TRUE,
  data_year = NULL
)
| regions | The region breakdown for the map, can be one of
( | 
| include | The regions to include in the resulting map. If  | 
| exclude | The regions to exclude in the resulting map. If  | 
| as_sf | Defunct, this parameter no longer has any effect and will be removed in the future. | 
| data_year | The year for which to obtain map data.
If the value is  | 
An sf data frame of US map coordinates divided by the desired regions.
str(us_map())
df <- us_map(regions = "counties")
west_coast <- us_map(include = c("CA", "OR", "WA"))
excl_west_coast <- us_map(exclude = c("CA", "OR", "WA"))
ct_counties_as_of_2022 <- us_map(regions = "counties", include = "CT", data_year = 2022)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.