Skip to content

Commit

Permalink
Add references to boundr and other relevant packages
Browse files Browse the repository at this point in the history
  • Loading branch information
cjrace committed Oct 20, 2024
1 parent f5bcf08 commit 4c5e68b
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ Where we can, we use their API to get the data, so that we have completely repro

On the [ONS Open Geography portal](https://geoportal.statistics.gov.uk/), you will usually be looking for data published as a feature or feature layer, as these are the ones made available via the API connection. You'll be able to preview the data in the browser and do basic searching / filtering on the table if you want to visualise it. Any feature data should have an option somewhere for 'I want to use this data' (or something similar if they update their website design) where you can get to an API explorer that allows you to run a basic query in the browser. In here you can usually find the dataset_id and also the parameters you want to use to get the data you need.

We have a `get_ons_api_data()` function that acts as a wrapper to the ONS API, it does things like converting readable parameters into a query string and also handles batching and multiple requests if needed, so you get all of the data in one nice neat data frame (there's a limit on the rows per single query for the API).
We have a `get_ons_api_data()` function that acts as a wrapper to the ONS API, it does things like converting readable parameters into a query string and also handles batching and multiple requests if needed, so you get all of the data in one nice neat data frame (there's a limit on the rows per single query for the API). If you're looking to expand on this function at all, you should first check if the [boundr package](https://github.com/francisbarton/boundr) does what you need, as that gives a number of methods for extracting data from the portal as well.

The way ONS publish has varied over their first few years of publishing, and on top of that each data set has an individual API connection for every year of boundaries. As there's no link over time from the ONS side we have helper functions defined in R/datasets_utils.R that wrap these up into a single neat time series bundle for us. Given the likelihood of further variations, don't be too surprised if adding new years to the data sets results in errors first time around, some manual fudgery is often needed so roll up your sleeves and prepare to get elbow deep into the murky depths of the R/datasets_utils.R file!

Expand Down
5 changes: 5 additions & 0 deletions R/get_ons_api_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
#' find the data set you're interested in and then use the query explorer to
#' find the information for the query.
#'
#' This function has been mostly developed for ease of use for dfeR maintainers
#' if you're interested in getting data from the Open Geography Portal more
#' widely you should also look at the
#' \href{https://github.com/francisbarton/boundr}{boundr package}.
#'
#' @param data_id the id of the data set to query, can be found from the Open
#' Geography Portal
#' @param query_params query parameters to pass into the API, see the ESRI
Expand Down
10 changes: 9 additions & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,15 @@ Functionality for dfeR is expected to focus around the following:

Documentation for what has been included in the package so far is on our [pkgdown site](http://dfe-analytical-services.github.io/dfeR/).

We are also developing the [dfeshiny](https://github.com/dfe-analytical-services/dfeshiny) package, and expect any functions specific to R Shiny applications will live there.
### Relevant other packages

We also maintain the [dfeshiny](https://github.com/dfe-analytical-services/dfeshiny) package, and expect any functions specific to R Shiny applications will live there.

For connecting to data in the [explore education statistics](https://explore-education-statistics.service.gov.uk/), we are building the [eesyapi](https://github.com/dfe-analytical-services/eesyapi) package.

There is a [giasr](https://github.com/dfe-analytical-services/giasr) package, which has been developed for connecting to data in the [get information about schools service](https://get-information-schools.service.gov.uk/).

While we have some DfE specific data in the dfeR package taken from the [Open Geography Portal](https://geoportal.statistics.gov.uk/). If you're looking at getting new data from the portal it is also worth looking at the [boundr](https://github.com/francisbarton/boundr) package, as this gives more functions for directly extracting data from there.

---

Expand Down
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,29 @@ Functionality for dfeR is expected to focus around the following:
Documentation for what has been included in the package so far is on our
[pkgdown site](http://dfe-analytical-services.github.io/dfeR/).

We are also developing the
### Relevant other packages

We also maintain the
[dfeshiny](https://github.com/dfe-analytical-services/dfeshiny) package,
and expect any functions specific to R Shiny applications will live
there.

For connecting to data in the [explore education
statistics](https://explore-education-statistics.service.gov.uk/), we
are building the
[eesyapi](https://github.com/dfe-analytical-services/eesyapi) package.

There is a [giasr](https://github.com/dfe-analytical-services/giasr)
package, which has been developed for connecting to data in the [get
information about schools
service](https://get-information-schools.service.gov.uk/).

While we have some DfE specific data in the dfeR package taken from the
[Open Geography Portal](https://geoportal.statistics.gov.uk/). If you’re
looking at getting new data from the portal it is also worth looking at
the [boundr](https://github.com/francisbarton/boundr) package, as this
gives more functions for directly extracting data from there.

------------------------------------------------------------------------

## Installation
Expand Down
3 changes: 3 additions & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@ Sys
UTLA
api
ay
boundr
center
ctry
cty
dbplyr
dfeshiny
eesyapi
fy
geoportal
giasr
gitignore
gor
gov
Expand Down
5 changes: 5 additions & 0 deletions man/get_ons_api_data.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4c5e68b

Please sign in to comment.