Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update readme & increment version #39

Merged
merged 12 commits into from
Sep 24, 2024
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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"),
Expand Down
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)

Expand Down
9 changes: 5 additions & 4 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand Down Expand Up @@ -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.

Expand Down
20 changes: 9 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 <https://www.opendata.nhs.scot/>, or extracted using
`ckanr::package_show`.
`list_resources()`.

library(phsopendata)

Expand Down Expand Up @@ -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:
Expand Down