-
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.
New feature - Translate natural geographic level naming to API abbrev…
…iations on query input (#70) * Added geographic level human-api lookup data * Added logic to todf_geographies to process natural geog level names into the API-expected ones * Updated hum friendly geog level terms * Remove unnecessary text from geog_level_lookup code * Updated documentation with geog_level_lookup * Fixing usethis warning by adding to the suggests dependencies * Update R/datasets_documentation.R Co-authored-by: Cam Race <52536248+cjrace@users.noreply.github.com> --------- Co-authored-by: Cam Race <52536248+cjrace@users.noreply.github.com>
- Loading branch information
Showing
9 changed files
with
156 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#' Create geographic_level API shorthand to natural language look-up | ||
#' | ||
#' @description | ||
#' Script for updating the package data file geog_level_lookup.rda with the look-up between API | ||
#' shorthands and natural language versions of geographic levels. | ||
#' | ||
#' @returns NULL | ||
#' @keywords internal | ||
#' | ||
#' @examples | ||
#' \dontrun{ | ||
#' create_geog_level_lookup() | ||
#' } | ||
create_geog_level_lookup <- function() { | ||
geog_level_lookup <- data.frame( | ||
api_friendly = c( | ||
"EDA", "INST", "LA", "LAD", | ||
"LEP", "LSIP", | ||
"MAT", "MCA", | ||
"NAT", "OA", | ||
"PA", "PCON", "PROV", | ||
"REG", "RSC", "SCH", "SPON", "WARD" | ||
), | ||
human_friendly = c( | ||
"English devolved area", "Institution", "Local authority", "Local authority district", | ||
"Local enterprise partnership", "Local skills improvement plan area", | ||
"Multi-academy trust", "MCA", | ||
"National", "Opportunity area", | ||
"Planning area", "Parliamentary constituency", "Provider", | ||
"Regional", "Regional school commissioner region", "School", "Sponsor", "Ward" | ||
) | ||
) | ||
# write it out to the data folder | ||
|
||
usethis::use_data(geog_level_lookup, 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#' Look-up for API geographic_level shorthands | ||
#' | ||
#' A look-up of API geographic_level shorthands and their respective natural forms. | ||
#' | ||
#' @format ## `geog_level_lookup` | ||
#' A data frame with 18 rows and 2 columns: | ||
#' \describe{ | ||
#' \item{api_friendly}{API geographic level shorthands} | ||
#' \item{human_friendly}{Natural language geographic levels} | ||
#' } | ||
#' @source curated by explore.statistics@@education.gov.uk | ||
"geog_level_lookup" |
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
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.
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