Census - Example - census

Data - Census

  lib_dir: libs self_contained: false bookdown::pdf_document2: citation_package: natbib number_sections: false fig_caption: yes toc: no —

~/data/census/

Tract-Level Maps: Los Angeles County

ACS 5

Code
variable.list.acs.2016 <- load_variables(2016, "acs5", cache = FALSE)

variable.list.acs.2016 |>
  filter(grepl("Share of Aggregate Income", label))
# # A tibble: 5 × 4
#   name       label                                             concept geography
#   <chr>      <chr>                                             <chr>   <chr>    
# 1 B19082_001 Estimate!!Quintile Share of Aggregate Income!!Lo… SHARES… tract    
# 2 B19082_002 Estimate!!Quintile Share of Aggregate Income!!Se… SHARES… tract    
# 3 B19082_003 Estimate!!Quintile Share of Aggregate Income!!Th… SHARES… tract    
# 4 B19082_004 Estimate!!Quintile Share of Aggregate Income!!Fo… SHARES… tract    
# 5 B19082_005 Estimate!!Quintile Share of Aggregate Income!!Hi… SHARES… tract

Decennial census

Code
variable.list.sf1 <- load_variables(2010, "sf1", cache = FALSE)

variable.list.sf1 |>
  filter(grepl("Income", concept))
# # A tibble: 0 × 3
# # ℹ 3 variables: name <chr>, label <chr>, concept <chr>
Code
# get_decennial(year = 1990) : endpoint 1990 supprime par le Census Bureau
# (annees valides : 2000, 2010, 2020) ; m90.county n'etait pas utilise ensuite.

Median Monthly Housing Costs

Code
options(tigris_use_cache = TRUE)
la <- get_acs(state = "CA", county = "Los Angeles", geography = "tract", 
              variables = "B25105_001", geometry = TRUE) |>
  rename(median_housing_costs = estimate)

mapview(la, zcol = "median_housing_costs", legend = TRUE)

Median Income

Code
options(tigris_use_cache = TRUE)
la <- get_acs(state = "CA", county = "Los Angeles", geography = "tract", 
              variables = "B19013_001", geometry = TRUE) |>
  rename(median_income = estimate)

mapview(la, zcol = "median_income", legend = TRUE)