if (FALSE) {
# Requires Census Bureau API key
library(data.table)
library(downloader)
library(jsonlite)
library(RcensusPkg)
# Request for data from Census Bureau which comes in the "wide" form
B19001_1yr_wide_dt <- RcensusPkg::get_vintage_data(
dataset = "acs/acs1",
vintage = 2016,
group = "B19001",
region = "state"
)
# Convert the returned data.table into "long" form
B19001_1yr_long_dt <- RcensusPkg::wide_to_long(
dt = B19001_1yr_wide_dt,
id_v = c("NAME","GEOID")
)
}
Run the code above in your browser using DataLab