Get data from the US Census Bureau Population Estimates APIs
get_estimates( geography = c("us", "region", "division", "state", "county", "county subdivision", "place/balance (or part)", "place", "consolidated city", "place (or part)", "metropolitan statistical area/micropolitan statistical area", "cbsa", "metropolitan division", "combined statistical area"), product = NULL, variables = NULL, breakdown = NULL, breakdown_labels = FALSE, year = 2019, state = NULL, county = NULL, time_series = FALSE, output = "tidy", geometry = FALSE, keep_geo_vars = FALSE, shift_geo = FALSE, key = NULL, show_call = FALSE, ... )
The geography of your data. Available geographies for the most recent data vintage are listed
be used an alias for
"metropolitan statistical area/micropolitan statistical area".
The data product (optional).
"characteristics" are supported.
A character string or vector of character strings of requested variables to get from either the population, components, or housing API.
The population breakdown used when
product = "characteristics".
Acceptable values are
"HISP", for Hispanic/Not Hispanic. These values can be combined in
a vector, returning population estimates in the
value column for all
combinations of these breakdowns.
Whether or not to label breakdown elements returned when
product = "characteristics". Defaults to FALSE.
The data vintage (defaults to 2019). It is recommended to use the most recent vintage
available for a given decennial series (so, year = 2019 for the 2010s) and
time_series = TRUE to access estimates for prior years.
The state for which you are requesting data. State names, postal codes, and FIPS codes are accepted. Defaults to NULL.
The county for which you are requesting data. County names and FIPS codes are accepted. Must be combined with a value supplied to `state`. Defaults to NULL.
TRUE, the function will return a time series of observations back to the decennial Census
of 2010. The returned column is either "DATE", representing a particular estimate date, or "PERIOD",
representing a time period (e.g. births between 2016 and 2017), and contains integers representing
those values. Integer to date or period mapping is available at
One of "tidy" (the default) in which each row represents an enumeration unit-variable combination, or "wide" in which each row represents an enumeration unit and the variables are in the columns.
if FALSE (the default), return a regular tibble of ACS data. if TRUE, uses the tigris package to return an sf tibble with simple feature geometry in the `geometry` column.
if TRUE, keeps all the variables from the Census shapefile obtained by tigris. Defaults to FALSE.
(deprecated) if TRUE, returns geometry with Alaska and Hawaii shifted for thematic
mapping of the entire US. As of May 2021, we recommend using
Your Census API key.
Obtain one at https://api.census.gov/data/key_signup.html. Can be stored
in your .Renviron with
census_api_key("YOUR KEY", install = TRUE)
if TRUE, display call made to Census API. This can be very useful in debugging and determining if error messages returned are due to tidycensus or the Census API. Copy to the API call into a browser and see what is returned by the API directly. Defaults to FALSE.
other keyword arguments
A tibble, or sf tibble, of population estimates data