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(tidyverse) | |
fips_lookup <- fips_codes %>% | |
distinct(state, state_code) | |
cd_wfh <- get_acs( | |
geography = "congressional district", | |
variables = "DP03_0024P", | |
year = 2021, |
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
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) |> |
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(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( |
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
# 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, |
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(tidyverse) | |
us_county_density <- get_decennial( | |
geography = "county", | |
variables = "P1_001N", | |
year = 2020, | |
geometry = TRUE, | |
keep_geo_vars = TRUE | |
) |
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(tidyverse) | |
library(tidycensus) | |
library(sf) | |
library(crsuggest) | |
options(tigris_use_cache = TRUE) | |
walk(state.name, ~{ | |
in_state <- get_acs( | |
geography = "tract", | |
variables = "B05002_003", |
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(tidyverse) | |
# Get the data | |
income_data <- get_acs( | |
geography = "county", | |
variables = "B19013_001", | |
state = "ME", | |
year = 2020, | |
geometry = TRUE |
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(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( |
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(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( |
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(ggspatial) | |
income <- get_acs( | |
geography = "tract", | |
variables = "B19013_001", | |
state = "TX", | |
county = "Tarrant", | |
geometry = TRUE | |
) |