Skip to contents

This function retrieves poverty data and population data grouped by age from the Census API, filters the data and processes it to return a merged dataframe with relevant information.

Usage

getPovertyPop(key, vars_pov, vars_pop, filt_age)

Arguments

key

A character string containing valid value of user's Census API key.

vars_pov

A character vector that specifies the variables to be retrieved for poverty data.

vars_pop

A character vector that specifies the variables to be retrieved for population data.

filt_age

An integer vector of length two specifying the minimum and maximum age group to filter population data.

Value

A merged dataframe with poverty and population count for each state.

Examples

data <- getPovertyPop("my_census_key", c("SAEMHI_PT"), c("POP"), c(12, 18))
#> Error in getCensus(name = "timeseries/poverty/saipe", key = key, vars = vars_pov,     region = "state:*", time = "2020"): could not find function "getCensus"