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(tigris) | |
options(tigris_use_cache = TRUE) | |
migrants <- get_pums( | |
variables = c("MIGSP", "PUMA"), | |
state = "all", | |
year = 2021, | |
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(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(tidycensus) | |
library(tigris) | |
library(tidyverse) | |
library(sf) | |
library(srvyr) | |
options(tigris_use_cache = TRUE) | |
sf_area <- metro_divisions() %>% | |
filter(GEOID %in% c("4186042034", "4186041884")) |
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
# remotes::install_github("walkerke/tidycensus") | |
library(tidycensus) | |
library(tidyverse) | |
library(showtext) | |
font_add_google("Roboto") | |
showtext_auto() | |
county_all <- get_estimates( | |
geography = "county", |
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
# Install packages (if necessary) | |
# install.packages(c("tidycensus", "tidyverse", "tmap", "mapview")) | |
# Load libraries | |
library(tidycensus) | |
library(tidyverse) | |
# Optional: if you plan to be a power user (500+ queries / day) | |
# Get a Census API key at https://api.census.gov/data/key_signup.html. | |
# Activate the key from the link in your email. |
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
# remotes::install_github("walkerke/tidycensus") | |
library(tidycensus) | |
library(tidyverse) | |
library(tigris) | |
options(tigris_use_cache = TRUE) | |
sysfonts::font_add_google("Roboto") | |
showtext::showtext_auto() | |
death_rates <- get_estimates(geography = "county", |
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
remotes::install_github("walkerke/tidycensus") | |
library(tidycensus) | |
library(tidyverse) | |
library(tigris) | |
options(tigris_use_cache = TRUE) | |
sysfonts::font_add_google("Roboto") | |
showtext::showtext_auto() |
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(tidycensus) | |
library(tigris) | |
library(tidyverse) | |
library(sf) | |
options(tigris_use_cache = TRUE) | |
sf_use_s2(FALSE) | |
top_places <- get_acs( | |
geography = "place", | |
variables = "B01001_001", |
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
# remotes::install_github("walkerke/tigris") | |
library(tigris) | |
options(tigris_use_cache = TRUE) | |
dfw_box <- c(-98.324890,31.877558,-95.344849,33.493307) | |
dfw_ua_10 <- urban_areas(filter_by = dfw_box) | |
dfw_ua_20 <- urban_areas(year = 2020, criteria = "2020", | |
filter_by = dfw_box) |