【问题标题】:Download all variables from all tables in the American Community Survey (ACS) 2013-2017 summary file for all census block groups in a state下载美国社区调查 (ACS) 2013-2017 摘要文件中所有表格中的所有变量,用于一个州的所有人口普查区块组
【发布时间】:2018-12-22 22:45:35
【问题描述】:

我已在此处下载了 2013-2017 年堪萨斯州美国社区调查 (ACS) 的原始摘要文件数据:https://www2.census.gov/programs-surveys/acs/summary_file/2017/data/5_year_by_state/Kansas_Tracts_Block_Groups_Only.zip

然后我将其解压缩到我工作目录中的文件夹“acs_2017_5_year”并运行以下代码:

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
) 

然后我得到这个错误:

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

如何下​​载堪萨斯州所有表格中的所有变量? table_contents 字段中有什么内容?如果没有简单的方法来表示“所有变量!”存在,是否有一个方便的列表,列出了我可以放入大量向量的所有变量名称?我一个都没找到。谢谢!

【问题讨论】:

    标签: r census


    【解决方案1】:

    您应该已经下载了 KS 2017 ACS5year 的所有内容。为了提取特定的 table_contents(或变量),您需要提供对参数 table_contents 的引用。运行search_tablecontents("acs5") 以查找参考。有超过 26000 个变量,因此将它们全部提取到一个 data.table 中是不现实的。

    【讨论】:

      猜你喜欢
      • 2016-07-18
      • 1970-01-01
      • 2012-01-24
      • 1970-01-01
      • 2021-03-14
      • 2017-09-25
      • 2012-12-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多