1

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.

Nissim
  • 11
  • 1
  • What I see is "tidycensus now supports the 2020 decennial Census PL-94171 redistricting data." What I do not see is that 'sf1' is supported yet, for 2020. My guess is that when load_variables(2010, "sf1", cache = TRUE) works, then we will be good to go. – George D Girton Apr 08 '22 at 17:42
  • George, have you noticed any changes since April? I'm still running into the same issue. – Nissim May 26 '22 at 18:26
  • Oops, I meant ' load_variables(2020, "sf1", cache = TRUE) '. Sorry to report it doesn't, today in late May. Meanwhile, the Census Bureau did say they have not released 2020 yet. So, to answer your question, I did not see a change since April. – George D Girton May 27 '22 at 20:23
  • Yeah, apparently only the redistricting data are out so far: https://github.com/walkerke/tidycensus/issues/457 – Nissim May 31 '22 at 13:12

0 Answers0