Use predicates to filter data in getCensus()
mainThe Census Bureau uses "predicates" (filterable parameter variables) to refine queries. You can pass these directly as named arguments to getCensus().
For example, when querying the Small Area Health Insurance Estimates (sahie), you can filter by IPRCAT (income group) and AGECAT (age group) to get highly specific demographic data.
# Get uninsured rate for nonelderly adults (AGECAT = 1)
# at 138% to 400% of the federal poverty line (IPRCAT = 5)
# in Los Angeles County, California
sahie_la <- getCensus(
name = "timeseries/healthins/sahie",
vars = c("NAME", "PCTUI_PT"),
region = "county:037",
regionin = "state:06",
time = "from 2012",
IPRCAT = 5,
AGECAT = 1)