diff --git a/DESCRIPTION b/DESCRIPTION index 16b36c6..f512ef0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: phsopendata Title: Extract Open Data from opendata.nhs.scot -Version: 0.1.0.9000 +Version: 0.2.0 Authors@R: c( person("Csilla", "Scharle", , "csilla.scharle2@phs.scot", role = c("aut", "cre")), person("James", "McMahon", , "james.mcmahon@phs.scot", role = "aut"), diff --git a/NEWS.md b/NEWS.md index 5bad634..1bb693b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# phsopendata (development version) +# phsopendata 0.2.0 (2024-09-18) - `get_dataset()` and `get_resource()` gain a new parameter `include_context` which allows adding context such as the resource ID and modified / created @@ -9,6 +9,7 @@ you've asked for doesn't exist (i.e. there's a typo) and there are multiple likely candidates (#28). - Two new functions `list_datasets()` and `list_resources()` allow browsing available datasets and resources (#10). +- The new function `get_latest_resource()` retrieves the most recent resource from a dataset with additional context such as the resource ID and modified / created dates (#36). # phsopendata 0.1.0 (2021-07-22) diff --git a/README.Rmd b/README.Rmd index 5c03111..9367b56 100644 --- a/README.Rmd +++ b/README.Rmd @@ -25,10 +25,11 @@ knitr::opts_chunk$set( - `get_resource()` extracts a single resource from an open dataset by resource id - `get_dataset()` extracts multiple resources from an open dataset by dataset name +- `list_datasets()` returns the names of all available datasets +- `list_resources()` returns information on all resources within an open dataset by dataset name -For extracting metadata and search functionality, we recommend using the [ckanr package](https://docs.ropensci.org/ckanr/). -`phsopendata` can be used on both the [server](https://rstudio.nhsnss.scot.nhs.uk/) and desktop versions of RStudio. However, depending on firewall settings, proxy use may need to be configured with `use_proxy()`. +`phsopendata` can be used on both Posit Workbench and desktop versions of RStudio. ## Installation @@ -46,7 +47,7 @@ remotes::install_github("Public-Health-Scotland/phsopendata", ### Downloading a data table with `get_resource()` -To extract a specific resource, you will need it's unique identifier - resource id. This can be found in the dataset metadata, the URL of a resource's page on https://www.opendata.nhs.scot/, or extracted using `ckanr::package_show`. +To extract a specific resource, you will need its unique identifier - resource id. This can be found in the dataset metadata, the URL of a resource's page on https://www.opendata.nhs.scot/, or extracted using `list_resources()`. ```{r example resource, eval = FALSE} library(phsopendata) @@ -83,7 +84,7 @@ get_resource( ### Downloading multiple tables with `get_dataset()` -To extract all resources from a dataset, you will need to use the *dataset name*. Note that this will differ from the *dataset title* that displays on the website. This can be found in the dataset metadata extracted using `ckanr::package_show`, or taken from the dataset URL. +To extract all resources from a dataset, you will need to use the *dataset name*. Note that this will differ from the *dataset title* that displays on the website. This can be found using `list_datasets()`, or taken from the dataset URL. In this example, we are downloading GP Practice Population Demographics from: [opendata.nhs.scot/dataset/*gp-practice-populations*](https://www.opendata.nhs.scot/dataset/gp-practice-populations), so the dataset name will be gp-practice-populations. diff --git a/README.md b/README.md index e8aad17..d5e265a 100644 --- a/README.md +++ b/README.md @@ -19,14 +19,12 @@ platform](https://www.opendata.nhs.scot/) via the CKAN API. resource id - `get_dataset()` extracts multiple resources from an open dataset by dataset name +- `list_datasets()` returns the names of all available datasets +- `list_resources()` returns information on all resources within an + open dataset by dataset name -For extracting metadata and search functionality, we recommend using the -[ckanr package](https://docs.ropensci.org/ckanr/). - -`phsopendata` can be used on both the -[server](https://rstudio.nhsnss.scot.nhs.uk/) and desktop versions of -RStudio. However, depending on firewall settings, proxy use may need to -be configured with `use_proxy()`. +`phsopendata` can be used on both Posit Workbench and desktop versions +of RStudio. ## Installation @@ -43,10 +41,10 @@ Using `remotes` you run this to install the package: ### Downloading a data table with `get_resource()` -To extract a specific resource, you will need it’s unique identifier - +To extract a specific resource, you will need its unique identifier - resource id. This can be found in the dataset metadata, the URL of a resource’s page on , or extracted using -`ckanr::package_show`. +`list_resources()`. library(phsopendata) @@ -84,8 +82,8 @@ You can use `col_select` and `row_filters` to query the data server-side To extract all resources from a dataset, you will need to use the *dataset name*. Note that this will differ from the *dataset title* that -displays on the website. This can be found in the dataset metadata -extracted using `ckanr::package_show`, or taken from the dataset URL. +displays on the website. This can be found using `list_datasets()`, or +taken from the dataset URL. In this example, we are downloading GP Practice Population Demographics from: