Description Usage Arguments Value Examples
Calculates aggregated sums and percentages for groups of ACS variables
1 | calc_acs_table(groups, denom, table)
|
groups |
A named list. Each item should be a numeric vector of column positions. Names will be used as aggregation terms |
denom |
A single-column ACS object, or one column of a larger ACS object, to be used as the denominator |
table |
An ACS object where |
Returns an acs-class
object, as is standard from the acs
package.
1 2 3 4 5 6 7 8 9 10 11 12 | # Calculate the share of CT population below poverty and below 2x poverty
# (numerators), out of all residents for whom poverty status is determined
# (denominator)
poverty_table <- acs.fetch(geography = geo.make(state = 9),
endyear = 2015, table.number = "C17002", col.names = "pretty")
pov_status_determined <- poverty[, 1]
pov_groups <- list(
below_poverty = 2:3,
low_income = 2:7
)
share_in_poverty <- calc_acs_table(pov_groups,
pov_status_determined, poverty_table)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.