Skip to content

Instantly share code, notes, and snippets.

View walkerke's full-sized avatar

Kyle Walker walkerke

View GitHub Profile
library(tidycensus)
library(tidyverse)
fips_lookup <- fips_codes %>%
distinct(state, state_code)
cd_wfh <- get_acs(
geography = "congressional district",
variables = "DP03_0024P",
year = 2021,
pop <- tidycensus::get_acs(
geography = "tract",
variables = "B01001_001",
state = "CA",
county = "Alameda",
year = 2020,
geometry = TRUE
)
oakland <- tigris::places("CA", cb = TRUE, year = 2020) |>
library(tidycensus)
library(tidyverse)
library(tigris)
library(sf)
options(tigris_use_cache = TRUE)
# You'll need a Census API key to get this to work
# census_api_key("YOUR KEY HERE")
vt_tract_pop <- get_decennial(
# remotes::install_github("walkerke/tidycensus")
library(tidycensus)
# census_api_key("your key here")
tarrant00 <- get_decennial(
geography = "tract",
variables = "DP2_C29",
state = "TX",
county = "Tarrant",
year = 2000,
library(tidycensus)
library(tidyverse)
us_county_density <- get_decennial(
geography = "county",
variables = "P1_001N",
year = 2020,
geometry = TRUE,
keep_geo_vars = TRUE
)
library(tidyverse)
library(tidycensus)
library(sf)
library(crsuggest)
options(tigris_use_cache = TRUE)
walk(state.name, ~{
in_state <- get_acs(
geography = "tract",
variables = "B05002_003",
library(tidycensus)
library(tidyverse)
# Get the data
income_data <- get_acs(
geography = "county",
variables = "B19013_001",
state = "ME",
year = 2020,
geometry = TRUE
library(tmap)
library(tidycensus)
options(tigris_use_cache = TRUE)
sf::sf_use_s2(FALSE)
tarrant_housing <- get_acs(
geography = "tract",
state = "TX",
county = "Tarrant",
variables = c(
library(tidycensus)
library(ggplot2)
library(mapboxapi)
library(sf)
options(tigris_use_cache = TRUE)
# Get the 2020 Census data
# Transform to a projected coordinate reference system
# to improve performance
twin_cities_race <- get_decennial(
library(tidycensus)
library(ggspatial)
income <- get_acs(
geography = "tract",
variables = "B19013_001",
state = "TX",
county = "Tarrant",
geometry = TRUE
)