In tidycensus, the "E" or "M" suffixes for variables are not required, per the tidycensus basic usage instructions.
Also, in the 2021 ACS 1 year data set, the geography zcta
is not supported. Instead, one can extract the C25032_001
variable with geography = "puma"
.
library(tidyverse)
library(tidycensus)
variables <- load_variables(2021, "acs1", cache = TRUE)
# returns error because zcta is not a supported geography in the public use microdata sample
acs_total_units <- get_acs(geography = "zcta",
state = "GA",
survey = "acs1",
variables = "C25032_001", year = 2021)
...and the output:
> acs_total_units <- get_acs(geography = "zcta",
+ state = "GA",
+ survey = "acs1",
+ variables = "C25032_001", year = 2021)
Getting data from the 2021 1-year ACS
The 1-year ACS provides data for geographies with populations of 65,000 and greater.
Using FIPS code '13' for state 'GA'
Error: Your API call has errors. The API message returned is error: unknown/unsupported geography heirarchy.
>
However, when we set geography = "puma"
the same query returns the requested data.
acs_total_units <- get_acs(geography = "puma",
state = "GA",
survey = "acs1",
variables = "C25032_001", year = 2021)
head(acs_total_units)
In the 2021 ACS 1 year survey, the state of Georgia has 72 PUMA areas. We'll print the first six.
> head(acs_total_units)
# A tibble: 6 × 5
GEOID NAME varia…¹ estim…² moe
<chr> <chr> <chr> <dbl> <dbl>
1 1300100 Coastal Regional Commission (South)--Glynn Camden & McIntosh Counties PUMA… C25032… 61393 2124
2 1300200 Coastal Regional Commission (West)--Liberty, Bryan & Long Counties PUMA; G… C25032… 45555 2022
3 1300300 Coastal Regional Commission (North)--Bulloch, Effingham & Screven Counties… C25032… 58124 2590
4 1300401 Coastal Regional Commission (East)--Chatham County (West Central)--Savanna… C25032… 70035 4145
5 1300402 Coastal Regional Commission (East)--Chatham County (East & Outside Savanna… C25032… 50993 4055
6 1300500 Southern Georgia Regional Commission (East & Central) PUMA, Georgia C25032… 58713 2413
# … with abbreviated variable names ¹variable, ²estimate
>
The complete list of geographies available for the 2021 ACS-1 public use microdata sample is available on the U.S. Census API Site, but the supported geographies table is posted here as a reference.
