get_decennial() returns error for 2020 data?

266 Views Asked by At

I've been working with census data from 2000, 2010, and 2020 for a local geography. My pulls for 2000 and 2010 work with no problem, but I get an error when I try to pull 2020 data.

vars = c("P001001", #Total population
         "H013001", #Total households
         "P016002", #Total population under 18
         "P020002" #Total!!Households with one or more people under 18 years
)

#import 2020 census data by block
phl_block_demos = get_decennial(geography = "block", 
                                year = 2020,
                                variables = vars,
                                geometry = T, #as an sf
                                sumfile = "sf1",
                                state = "PA",
                                county = "Philadelphia",
                                output = "wide") |>
  st_transform(crs = st_crs("EPSG:4326")) |>
  mutate(tract_num = substr(GEOID, 1, 11))

R returns

Using the PL 94-171 Redistricting Data summary file Error in UseMethod("select") : no applicable method for 'select' applied to an object of class "character"

I get the same error message when I change the geography to "tract", when I set geometry = F, and when I run only the part of the code before the first pipe. The only thing that seems to work is picking a different census year, since 2000 and 2010 work fine.

Any ideas what the issue is? The data were just released earlier this month so I haven't been able to find anything about this online yet.

0

There are 0 best solutions below