This file contains 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(tigris) | |
library(tidyverse) | |
library(sf) | |
library(ggiraph) | |
library(patchwork) | |
options(tigris_use_cache = TRUE) | |
set.seed(123456) | |
# Get a list of counties within the Austin CBSA using tigris |
This file contains 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(mapboxapi) | |
library(mapview) | |
mb_access_token("YOUR TOKEN GOES HERE") | |
isos <- mb_isochrone("2500 Victory Ave, Dallas TX", | |
time = c(5, 10, 15), | |
profile = "driving-traffic") | |
mapview(isos, zcol = "time", |
This file contains 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(tidyverse) | |
library(showtext) | |
font_add_google("Montserrat") | |
showtext_auto() | |
us_occ_pums <- get_pums( | |
variables = c("OCCP", "WAGP"), | |
state = "all", | |
survey = "acs1", |
This file contains 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(tigris) | |
library(tidyverse) | |
library(sf) | |
options(tigris_use_cache = TRUE) | |
set.seed(123456) | |
austin_counties <- counties(year = 2021) %>% | |
filter(CBSAFP == "12420") %>% | |
pull(COUNTYFP) |
This file contains 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(tidyverse) | |
options(tigris_use_cache = TRUE) | |
state_names <- c(state.name, "District of Columbia") | |
names(state_names) <- state_names | |
tictoc::tic() | |
age_maps <- map(state_names, ~{ | |
This file contains 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(tidyverse) | |
library(tidycensus) | |
library(showtext) | |
font_add_google("Montserrat") | |
showtext_auto() | |
continental <- read_csv("https://www.ncei.noaa.gov/access/monitoring/climate-at-a-glance/county/mapping/110-tavg-202402-1.csv", skip = 4) |> | |
mutate(avg_temp = as.numeric(Value), | |
GEOID = map_chr(ID, ~{ | |
last3 <- str_sub(.x, start = -3) |
This file contains 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
# Requires tidycensus dev version | |
# remotes::install_github("walkerke/tidycensus") | |
library(tidyverse) | |
library(tidycensus) | |
library(showtext) | |
font_add_google("Montserrat") | |
showtext_auto() | |
pres_results <- read_csv("https://raw.githubusercontent.com/tonmcg/US_County_Level_Election_Results_08-20/master/2020_US_County_Level_Presidential_Results.csv") |
This file contains 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(sf) | |
library(tigris) | |
library(tidycensus) | |
library(tidyverse) | |
library(mapview) | |
library(mapboxapi) | |
library(randomNames) | |
options(tigris_use_cache = TRUE) | |
denton <- counties(cb = TRUE) %>% |
This file contains 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(mapboxapi) | |
library(tidycensus) | |
library(tidyverse) | |
library(sf) | |
library(ggspatial) | |
options(tigris_use_cache = TRUE) | |
# Get the data from the ACS | |
tarrant <- get_acs( | |
geography = "tract", |
This file contains 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(tidyverse) | |
library(sf) | |
library(mapboxapi) | |
library(tigris) | |
library(fasterize) | |
library(leaflet) | |
# Get county boundaries; you can analyze for any county | |
target_GEOID <- "48309" |
NewerOlder