-
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.
Add rec_centers data + update adopted_plans
Also reorganize NEWS
- Loading branch information
1 parent
c374c4c
commit b6c1b39
Showing
9 changed files
with
187 additions
and
16 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
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,61 @@ | ||
library(dplyr) | ||
library(stringr) | ||
|
||
url <- "https://services1.arcgis.com/UWYHeuuJISiGmgXx/arcgis/rest/services/recreationCenter2023/FeatureServer" | ||
|
||
rec_centers_source <- esri2sf::esri2sf(url, crs = 2804) | ||
|
||
rec_centers <- rec_centers_source |> | ||
getdata::rename_with_xwalk( | ||
xwalk = tibble::tribble( | ||
~label, ~variable, | ||
"OBJECTID", "OBJECTID", | ||
"street_address", "ADDRESS", | ||
"address", "addressFull", | ||
"center_type", "TYPE", | ||
"school_name", "schoolName", | ||
"center_amenities", "amenity", | ||
"notes", "note", | ||
"CURRENT_", "CURRENT_", | ||
"operator", "OPERATOR", | ||
"inCivicRec", "inCivicRec", | ||
"inDivisionList", "inDivisionList", | ||
"center_assets", "civicRecAsset", | ||
"center_category", "CATEGORY", | ||
"name", "NAME", | ||
"recreation_district", "recDistrict", | ||
"park_district", "parkDstrct", | ||
"council_district", "cnclDistrict", | ||
"legislative_district", "lgsltvDstrct", | ||
"police_district", "policeDstrct", | ||
"id", "GISID", | ||
"geoms", "geoms" | ||
) | ||
) |> | ||
dplyr::mutate( | ||
name_short = name, | ||
# FIXME: Distinguish between community center and rec center names | ||
name = paste0(name, " Rec Center"), | ||
police_district = str_to_sentence(police_district) | ||
) |> | ||
dplyr::relocate( | ||
"id", "name", "name_short", | ||
ends_with("address"), starts_with("center"), | ||
"school_name", "operator", ends_with("district"), | ||
.before = everything() | ||
) |> | ||
dplyr::relocate( | ||
"center_type", | ||
.before = "school_name" | ||
) |> | ||
dplyr::select(!c("CURRENT_", "inCivicRec", "inDivisionList", "OBJECTID")) |> | ||
naniar::replace_with_na( | ||
list( | ||
school_name = "", | ||
center_amenities = "", | ||
notes = "" | ||
) | ||
) |> | ||
sfext::rename_sf_col() | ||
|
||
usethis::use_data(rec_centers, 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.