This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(tidycensus) | |
| library(mapgl) | |
| library(tidyverse) | |
| library(sf) | |
| options(tigris_use_cache = TRUE) | |
| # Universe: adults (18+) born in the 50 states or DC. Excludes the | |
| # foreign-born as well as natives born in Puerto Rico, the U.S. Island | |
| # Areas, or abroad to U.S.-citizen parents, none of whom have a state | |
| # of birth. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ------------------------------------------------------------------------- | |
| # What do plumbers actually earn? | |
| # | |
| # Fact-check of the viral claim that plumbers are "clearing $250k-$300k/year", | |
| # using the 2024 1-year American Community Survey Public Use Microdata Sample | |
| # (PUMS), accessed with tidycensus. | |
| # | |
| # Universe: employed plumbers, pipefitters, and steamfitters (SOC 47-2152) | |
| # in the United States. Estimates use the PUMS person weight (PWGTP). | |
| # (For standard errors, add rep_weights = "person" to the get_pums() call |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(tidycensus) | |
| library(mapgl) | |
| library(tidyverse) | |
| library(sf) | |
| options(tigris_use_cache = TRUE) | |
| adult_total_vars <- paste0("B06001_", sprintf("%03d", 4:12)) | |
| adult_born_vars <- paste0("B06001_", sprintf("%03d", 16:24)) | |
| puma_birth <- get_acs( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(tidycensus) | |
| library(mapgl) | |
| library(tidyverse) | |
| library(sf) | |
| library(tigris) | |
| options(tigris_use_cache = TRUE) | |
| adult_total_vars <- paste0("B06001_", sprintf("%03d", 4:12)) | |
| adult_born_vars <- paste0("B06001_", sprintf("%03d", 16:24)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(tigris) | |
| library(mapgl) | |
| library(freestiler) | |
| library(tidyverse) | |
| options(tigris_use_cache = TRUE) | |
| ac_estimates <- read_csv( | |
| "https://www2.census.gov/programs-surveys/demo/datasets/lace/2023/LACE_23_Tract.csv" | |
| ) |> | |
| mutate(GEOID = str_sub(GEO_ID, start = -11)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(mapgl) # Get the new features: pak::pak("walkerke/mapgl") | |
| library(tidycensus) | |
| library(sf) | |
| library(tidyverse) | |
| sf_use_s2(FALSE) | |
| tx_bgs <- get_acs( | |
| geography = "block group", | |
| variables = "B01001_001", | |
| state = "TX", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Day 27: Boundaries - World Time Zones | |
| # The invisible lines that govern our daily lives | |
| # Uses current IANA time zone rules, including daylight saving time at render time. | |
| library(mapgl) | |
| library(sf) | |
| library(dplyr) | |
| library(lubridate) | |
| tz_release <- "2026b" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Day 26: Transport - US Electric Power Transmission Lines | |
| # Visualizing America's invisible highway: 700,000+ miles of power lines | |
| # Dynamic line widths by voltage class, glowing effect for the energy flow | |
| library(mapgl) | |
| library(sf) | |
| library(dplyr) | |
| # Load transmission lines from HIFLD (Homeland Infrastructure Foundation-Level Data) | |
| # This is a large dataset - we'll use direct URL for the GeoJSON |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Day 25: Hexagons - US Wind Energy Infrastructure | |
| # Multi-resolution H3 hexagonal aggregation of 72,000+ wind turbines | |
| # Aggregating total installed capacity (MW) per hexagon | |
| # Points fade in at high zoom for individual turbine exploration | |
| library(mapgl) | |
| library(h3o) | |
| library(sf) | |
| library(dplyr) | |
| library(readr) |
NewerOlder