df <- getCensus(name = "acs/acs5", vintage = 2017,
vars = c("B01001_001E", "NAME", "B01002_001E", "B19013_001E"),
region = "tract:*", regionin = "state:06")
head(df)
# Use American Community Survey variable groups to get all data from a given table.
# This returns estimates as well as margins of error and annotation flags.
acs_group <- getCensus(name = "acs/acs5",
vintage = 2017,
vars = c("NAME", "group(B19013)"),
region = "county:*")
head(acs_group)
# Retreive block-level data within a specific tract using a nested regionin argument
data2010 <- getCensus(name = "dec/sf1",
vintage = 2010,
vars = c("NAME","P001001"),
region = "block:*",
regionin = "state:36+county:027+tract:010000")
head(data2010)
# Get poverty rates for children and all ages over time
saipe <- getCensus(name = "timeseries/poverty/saipe",
vars = c("NAME", "SAEPOVRT0_17_PT", "SAEPOVRTALL_PT"),
region = "state:01",
time = "from 2000 to 2017")
head(saipe)
# Get county business patterns data for a specific NAICS sector
cbp_2016 <- getCensus(name = "cbp",
vintage = "2016",
vars = c("EMP", "ESTAB", "NAICS2012_TTL", "GEO_TTL"),
region = "state:*",
naics2012 = "23")
head(cbp_2016)
Run the code above in your browser using DataLab