tidycensus::get_decennial returns a decennial data table with its variable codes, which can be joined with cwi::decennial_vars20 to get readable labels. This function is just a quick wrapper around the common task of joining these two data frames.

label_decennial(data, year = 2020, sumfile = "dhc", variable = variable)

Arguments

data

A data frame/tibble.

year

The year of decennial census data; defaults 2020.

sumfile

A string: which summary file to use. Defaults to "dhc", the code used for 2020. 2010 used summary files labeled "sf1" or "sf3".

variable

The bare column name of variable codes; defaults to variable, as returned by tidycensus::get_decennial.

Value

A tibble

See also