fips_data: Retrieve state and county FIPS codes

View source: R/fips-data.R

fips_dataR Documentation

Retrieve state and county FIPS codes

Description

Retrieve state and county FIPS codes

Usage

fips_data(
  regions = c("states", "state", "counties", "county"),
  as_sf = TRUE,
  data_year = NULL
)

Arguments

regions

The region breakdown for the map, can be one of ("states", "state", "counties", "county"). The default is "states".

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 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.

Value

An data frame of FIPS codes of the desired regions.

Examples

str(fips_data())

state_fips <- fips_data()
county_fips <- fips_data(regions = "counties")


pdil/usmapdata documentation built on Jan. 22, 2025, 10:52 p.m.