-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
400 additions
and
71 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
^renv$ | ||
^renv\.lock$ | ||
^.*\.Rproj$ | ||
^\.Rproj\.user$ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
TIGRIS_CACHE_DIR=inputs/tigris_cache |
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
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# counties that make up Baltimore metro area | ||
# metropolitan statistical areas come from census bureau's TIGER database via the tigris package | ||
# returns an sf object with geometries | ||
msa_sf <- tigris::core_based_statistical_areas(year = 2023, progress = FALSE, refresh = FALSE) |> | ||
janitor::clean_names() |> | ||
dplyr::select(name, geoid) | ||
# md county geos also from TIGER | ||
# if we don't actually need the county shapes, intersecting with their centroids is easier | ||
county_cents <- tigris::counties(state = "MD", progress = FALSE, refresh = FALSE) |> | ||
janitor::clean_names() |> | ||
sf::st_centroid() | ||
|
||
# filter msa for just the one that has Baltimore in the name, | ||
# get intersection with counties | ||
# pull out the full names column into a vector | ||
balt_metro <- msa_sf |> | ||
dplyr::filter(grepl("Baltimore", name)) |> | ||
sf::st_intersection(county_cents) |> | ||
dplyr::pull(namelsad) | ||
|
||
# delete the county centroids since we don't need them | ||
rm(county_cents) |
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
Oops, something went wrong.