-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add neighborhoods_2020 + baltimore_census_xwalk data
- Loading branch information
1 parent
b6c1b39
commit a82ef25
Showing
9 changed files
with
263 additions
and
4 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
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,74 @@ | ||
## code to prepare `area_xwalk` dataset goes here | ||
|
||
library(getACS) | ||
library(tidyverse) | ||
|
||
block_xwalk <- make_block_xwalk( | ||
"MD", | ||
"Baltimore city" | ||
) | ||
|
||
area_xwalk_list_housing <- map( | ||
list( | ||
mapbaltimore::council_districts, | ||
mapbaltimore::neighborhoods, | ||
neighborhoods_2020, | ||
mapbaltimore::planning_districts | ||
), | ||
\(x) { | ||
make_area_xwalk( | ||
x, | ||
block_xwalk, | ||
coverage = FALSE, | ||
name_col = "name", | ||
weight_col = "HOUSING20" | ||
) | ||
} | ||
) | ||
|
||
area_xwalk_housing <- purrr::list_rbind( | ||
set_names( | ||
area_xwalk_list_housing, | ||
c("council district 2010", | ||
"neighborhood 2010", | ||
"neighborhood 2020", | ||
"planning district") | ||
), | ||
names_to = "geography" | ||
) | ||
|
||
area_xwalk_list_pop <- map( | ||
list( | ||
mapbaltimore::council_districts, | ||
mapbaltimore::neighborhoods, | ||
neighborhoods_2020, | ||
mapbaltimore::planning_districts | ||
), | ||
\(x) { | ||
make_area_xwalk( | ||
x, | ||
block_xwalk, | ||
coverage = FALSE, | ||
name_col = "name", | ||
weight_col = "POP20" | ||
) | ||
} | ||
) | ||
|
||
area_xwalk_pop <- purrr::list_rbind( | ||
set_names( | ||
area_xwalk_list_pop, | ||
c("council district 2010", | ||
"neighborhood 2010", | ||
"neighborhood 2020", | ||
"planning district") | ||
), | ||
names_to = "geography" | ||
) | ||
|
||
baltimore_census_xwalk <- dplyr::full_join( | ||
area_xwalk_pop, | ||
area_xwalk_housing | ||
) | ||
|
||
usethis::use_data(baltimore_census_xwalk, overwrite = 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
Binary file not shown.
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.