| census_block_group_populations | R Documentation |
Retrieve Urban and Rural (p2) Summary File 1 (sf1) Census data
census_block_group_populations(
state_fips_code,
vintage = c("2010", "2000"),
key = Sys.getenv("CENSUS_KEY")
)
state_fips_code |
Two-digit state code (e.g., "01" == "Alabama"). |
vintage |
= Year of dataset, e.g., 2000. This data is only collected during decennial censuses. |
key |
Your Census API key, requested using https://api.census.gov/data/key_signup.html. |
Decennial Census API Documentation https://www.census.gov/data/developers/data-sets/decennial-census.html
URBAN AND RURAL variables listed in: https://api.census.gov/data/2010/dec/sf1/variables.html
| Name | Label | Concept | Required | Attributes | Limit | Predicate Type | Group |
| P002001 | Total | URBAN AND RURAL | not required | P002001ERR | 0 | int | P2 |
| P002002 | Total!!Urban | URBAN AND RURAL | not required | 0 | int | P2 | |
| P002003 | Total!!Urban!!Inside urbanized areas | URBAN AND RURAL | not required | 0 | int | P2 | |
| P002004 | Total!!Urban!!Inside urban clusters | URBAN AND RURAL | not required | 0 | int | P2 | |
| P002005 | Total!!Rural | URBAN AND RURAL | not required | 0 | int | P2 |
A tibble with FIPS codes and P2 variables by tract group for the desired state.
## Not run:
## data for all block groups in Missouri
census_block_group_populations("29")
## data for all block groups
fips_codes_for_states_and_dc %>%
mutate(data = purrr::map(
state_fips_code,
census_block_group_populations
)) %>%
tidyr::unnest(cols = c(data))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.