get_estimates() now defaults to Vintage 2025 and supports Puerto Rico: municipio population and age / sex characteristics are available with geography = "county", state = "PR", and Puerto Rico metro areas are included in CBSA and CSA population estimates (#581).get_estimates() now supports the Census Bureau's intercensal estimates with product = "intercensal": use vintage = 2020 for 2010-2020 and vintage = 2010 for 2000-2010. Population totals are available for states, counties, and places, and characteristics by age, sex, race, and Hispanic origin for counties (#629). Population characteristics requests also now support geometry = TRUE and multiple states for counties.drop_empty argument in get_acs(), get_decennial(), and get_estimates() drops rows with empty geometries (typically water-only areas not in the cartographic boundary files) when geometry = TRUE (#650). These functions also now have an explicit cb argument, which defaults to TRUE (cartographic boundary files); use cb = FALSE for TIGER/Line files (#604).get_estimates() now supports housing unit estimates for 2020 and later with product = "housing" (Vintage 2021 and later) for the US, regions, states, and counties. The Census Bureau publishes these only as Excel tables, so the readxl package is required.get_flows() now defaults to year = 2020, the most recent ACS Migration Flows release with county-to-county flows, and supports the 2017-2021 and 2018-2022 releases, which provide flows between counties and states or world regions (inflows only, with no county subdivision, MSA, or geometry support).get_acs() and get_decennial() now support metropolitan divisions (geography = "metropolitan division") and tribal census tracts (geography = "tribal census tract"), returned for the entire US (#519, #621).suffix argument in get_acs() sets the estimate and margin of error suffixes for output = "wide", e.g. suffix = c("_est", "_moe"); the default remains c("E", "M") (#600).get_acs() and get_decennial() have a new labels argument. labels = TRUE names variables from their labels instead of their IDs (e.g. total_male_under_5_years), in tidy or wide output; labels = "concept" adds the concept to those names; and labels = "attributes" keeps the IDs and attaches readable labels (e.g. "Total > Male > Under 5 years") to the columns of wide output. load_variables(clean_labels = TRUE) returns the same cleaned labels.load_variables() now includes each table's universe where the Census API publishes it (ACS detailed tables and the 2020 decennial files) (#596).load_variables() and get_pop_groups(). Tidycensus will now error (rather than warn) when no key is available. Pass a key with the key argument or store one for future sessions with census_api_key("YOUR KEY", install = TRUE). load_variables() and get_pop_groups() gain a key argument, and table lookups triggered by the table = argument to get_acs() / get_decennial() now forward the resolved key automatically.get_estimates() now supports the 2025 city / place population estimates with geography = "place" and vintage = 2025.get_decennial() now normalizes state-prefixed ZCTA GEOIDs returned by selected decennial API endpoints before joining to geometry.get_pums(return_vacant = TRUE) now qualifies internal PUMS metadata lookups so the function works correctly when called with tidycensus::get_pums().get_acs() and get_pums() updated to 2023 following full release of the 2023 ACS datasets.get_estimates() for the 2023 PEP datasets. A new argument, vintage, allows users to request data by vintage and then by year within that vintage for post-2020 PEP datasets.get_acs() and get_pums() updated to 2022 following full release of the 2022 ACS datasets.get_decennial() when sumfile = "cd118" is used, and in get_acs()pop_group argument.get_estimates() now supports the newer Population Estimates Program (PEP) datasets not found on the Census API. Please review the package documentation at https://walker-data.com/tidycensus/articles/other-datasets.html for examples of how to use the new datasets, which differ slightly from older versions.summary_files() function.get_decennial() has been updated to accommodate the new Demographic and Housing Characteristics and Demographic Profile summary files. Use sumfile = "dhc" for the DHC file, and sumfile = "dp" for the DP file.get_decennial() is now 2020. This may be a breaking change for some legacy code that omits the year, so be sure to update scripts to hard-code the year for years earlier than 2020.sumfile = "pl" is the default for get_decennial() and will remain so to avoid existing code breakages. Please note that variable IDs are replicated across the PL and DHC files, but may represent different topics.pums_variables data dictionary object.interpolate_pw() function; and correct geometry usage for PUMA geography in the 2021 ACS.get_acs() and get_pums() now default to year = 2020 to retrieve data from the 2016-2020 5-year ACS. 2020 1-year data are not available in tidycensus and the package throws an error message; users should hard-code a different year to get 1-year ACS data.as_dot_density() function allows users to quickly generate dots from data for dot-density mapping. This function requires the terra package to be installed.interpolate_pw() function supports population-weighted interpolation of data between incongruent geometries, based on Esri's weighted block centroid apportionment algorithm. A common use-case will be interpolating pre-2020 data to 2020 geometries like Census tracts and block groups.get_pums() now correctly returns vacant housing units either when the VACS variable is requested or when return_vacant = TRUE.get_acs() now supports the ACS Comparison Profile data, helping users perform longitudinal demographic analyses correctly.load_variables() now returns a geography column for the 5-year ACS Detailed Tables that tells users the smallest geography at which any given variable is available.year = 2020 in a call to get_decennial() to access the data, and load_variables(2020, "pl") to look up variable IDs."voting district" is now available for 2020 to assist with redistricting analyses.get_flows(). Browse the supporting documentation for information on how to analyze and map migration flows data in tidycensus.shift_geo argument is deprecated in favor of using the new tigris::shift_geometry() function. This allows for shifting of geometries for any geography in national mapping projects.get_pums(). Updated variable definitions are found in the data object pums_variables.get_pums() is updated to 2019.get_acs() now supports the state parameter for zip code tabulation areas (ZCTAs) to allow subsetting by state.NEWS.md file to track changes to the package.get_acs() now defaults to year = 2019, meaning that 2015-2019 5-year estimates and 2019 1-year estimates are retrieved if no year is specified.get_estimates() now also defaults to year = 2019.get_decennial() as the Census Bureau has restored its API endpoint.geometry = TRUE now works for all geographies currently available in tidycensus.get_acs() can now support the ACS Supplemental Estimates API.get_acs() now defaults to the 2014-2018 five-year American Community Survey estimates, or the 2018 1-year estimates if users set survey = "acs1".tidycensus now includes support for the Census Bureau Population Estimates API. Please see https://walkerke.github.io/tidycensus/articles/other-datasets.html for examples of how to use these new features.
Important internal changes to ensure that tidycensus continues to work with upcoming changes to Census API endpoints.
Several internal improvements and bug fixes. Please see the closed issues at https://github.com/walkerke/tidycensus/issues for a list.
Bug fixed that was causing GEOIDs for some states to be converted to NA on certain Linux platforms
A new parameter, shift_geo, allows tidycensus users to get US state and county geometry originally obtained with the albersusa R package with Alaska and Hawaii shifted and re-scaled for better cartographic display of the entire US.
library(tidycensus)
library(tidyverse)
library(viridis)
us_county_income <- get_acs(geography = "county", variables = "B19013_001",
shift_geo = TRUE, geometry = TRUE)
ggplot(us_county_income) +
geom_sf(aes(fill = estimate), color = NA) +
coord_sf(datum = NA) +
theme_minimal() +
scale_fill_viridis_c()