Skip to content

Instantly share code, notes, and snippets.

@dgkeyes
Created March 24, 2022 21:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dgkeyes/16f14cba42a2996d6cea1d63b7590767 to your computer and use it in GitHub Desktop.
Save dgkeyes/16f14cba42a2996d6cea1d63b7590767 to your computer and use it in GitHub Desktop.
library(tidycensus)
library(tidyverse)
us_state_pop <- get_acs(
geography = "state",
year = 2019,
variables = c("population" = "B01001_001"),
geometry = TRUE)
us_state_pop %>%
filter(NAME == "Florida")
non_contiguous_regions <- c("Alaska", "Hawaii", "Rhode Island", "Puerto Rico")
us_contiguous <- us_state_pop %>%
filter(!NAME %in% non_contiguous_regions)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment