R:如何从tidycensus命名get_acs中的列?

时间:2019-01-08 16:10:52

标签: r tibble tidycensus

我跑步时

age <- get_acs(geography="tract",table="B01001",state="IL")

我收到以下错误:

Getting data from the 2012-2016 5-year ACS
Loading ACS5 variables for 2016 from table B01001. To cache this dataset for faster access to ACS tables in the future, run this function with `cache_table = TRUE`. You only need to do this once per ACS dataset.
Using FIPS code '17' for state 'IL'
Error: Columns 1, 2, 3, 4, 5, … (and 47 more) must be named.
Use .name_repair to specify repair.

它也具有以下回溯:

 ─tidycensus::get_acs(...)
 ─purrr::map(...)
 ─tidycensus:::.f(.x[[i]], ...)
 ─tidycensus:::load_data_acs(...)
 ─dplyr::tbl_df(fromJSON(content))
 ─tibble:::as_tibble.matrix(data, .name_repair = "check_unique")
 ─tibble:::as_tibble.data.frame(m, ..., .name_repair = .name_repair)
 ─tibble:::as_tibble.list(unclass(x), ..., .rows = .rows, .name_repair = .name_repair)
 ─tibble:::lst_to_tibble(x, .rows, .name_repair, col_lengths(x))
 ─tibble:::set_repaired_names(x, .name_repair)
 ─tibble:::repaired_names(names(x), .name_repair = .name_repair)
 ─tibble:::check_unique(new_name)

什么是.name_repair?如何使用它来指定维修?还是有其他解决方法?

1 个答案:

答案 0 :(得分:1)

我已经向CRAN发布了新版本的tidycensus(0.9),可以解决此问题-如果遇到此问题,请进行更新!