rilkehayden
rilkehayden

Reputation: 63

Download all variables from all tables in the American Community Survey (ACS) 2013-2017 summary file for all census block groups in a state

I've downloaded the raw summary file data for the American Community Survey (ACS) 2013-2017 for Kansas here: https://www2.census.gov/programs-surveys/acs/summary_file/2017/data/5_year_by_state/Kansas_Tracts_Block_Groups_Only.zip

I then unzipped it into the folder "acs_2017_5_year" in my working directory and ran this code:

library(totalcensus)

#### raw acs data import ####
set_path_to_census("acs_2017_5_year")

trying_acs <- read_acs5year(
  year = 2017,
  states = "KS",
  table_contents = "*",
  summary_level = "block group", 
  with_margin = TRUE
) 

I then get this error:

Error in read_acs5year_geoheaders_(year, states, table_contents, geo_headers,  : 
  The table content reference * does not exist.

What can I do to download all the variables in all the tables for Kansas? What goes in the table_contents field? If no simple way to indicate "all the variables!" exists, is there a handy list of all the variable names somewhere that I could chuck into a massive vector? I haven't been able to find either one. Thank you!

Upvotes: 0

Views: 197

Answers (1)

GL_Li
GL_Li

Reputation: 1798

You should have already downloaded everything for KS 2017 ACS5year. In order to extract particular table_contents (or variables), you need to provide the references to argument table_contents. Run search_tablecontents("acs5") to find out the references. There are over 26000 variables so it is not realistic to extract all of them into one data.table.

Upvotes: 1

Related Questions