if (FALSE) {
# Requires Census Bureau API key
library(data.table)
library(httr2)
library(jsonlite)
library(stringr)
library(RcensusPkg)
# Request for data from Census Bureau in "long" form
B19001_1yr_long_dt <- RcensusPkg::get_vintage_data(
dataset = "acs/acs1",
vintage = 2016,
group = "B19001",
region = "state",
wide_to_long = TRUE
)
# Resulting data.table is in the "long" form. Convert it back to
# to the wide form.
B19001_1yr_wide_dt <- RcensusPkg::long_to_wide(
dt = B19001_1yr_long_dt,
parameter_col = "variable",
value_col = c("estimate", "moe")
)
}
Run the code above in your browser using DataLab