Skip to content

Commit

Permalink
try and fix merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
ross-hull committed Jul 3, 2024
2 parents 8142c5e + 2ae53d9 commit 4f608a4
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
Package: phsopendata
Title: Extract Open Data from opendata.nhs.scot
Version: 0.1.0
Version: 0.1.0.9000
Authors@R: c(
person("Csilla", "Scharle", , "[email protected]", role = c("aut", "cre")),
person("James", "McMahon", , "[email protected]", role = "aut"),
person("David", "Aikman", , "[email protected]", role = "aut")
person("David", "Aikman", , "[email protected]", role = "aut"),
person("Ross", "Hull", , "[email protected]", role = "aut")
)
Description: Functions to extract and interact with data from the Scottish
Health and Social Care Open Data platform.
Expand Down
12 changes: 12 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# phsopendata (development version)

- `get_dataset()` and `get_resource()` gain a new parameter `include_context`
which allows adding context such as the resource ID and modified / created
dates to returned data (#24).
- The magrittr pipe (`%>%`) is now exported (#29).
- `get_dataset()` will now suggest multiple dataset names, when the dataset
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).

# phsopendata 0.1.0 (2021-07-22)

- Initial package release.
Expand Down
6 changes: 3 additions & 3 deletions R/get_dataset_additional_info.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#' get_dataset("gp-practice-populations")
get_dataset_additional_info <- function(dataset_name){

Check warning on line 12 in R/get_dataset_additional_info.R

View workflow job for this annotation

GitHub Actions / lint

file=R/get_dataset_additional_info.R,line=12,col=54,[brace_linter] There should be a space before an opening curly brace.

Check warning on line 12 in R/get_dataset_additional_info.R

View workflow job for this annotation

GitHub Actions / lint

file=R/get_dataset_additional_info.R,line=12,col=54,[paren_body_linter] There should be a space between a right parenthesis and a body expression.
#define query

query <- list("id" = dataset_name)
#fetch the data
content <- phs_GET("package_show", query)
Expand All @@ -19,6 +20,7 @@ get_dataset_additional_info <- function(dataset_name){
amount_of_resources <- content$result$resources %>%
length()


#get the last recourse created and modified dates
last_resource_created_date <- purrr::map_chr(content$result$resources, ~.$created)

Check warning on line 25 in R/get_dataset_additional_info.R

View workflow job for this annotation

GitHub Actions / lint

file=R/get_dataset_additional_info.R,line=25,col=81,[line_length_linter] Lines should not be more than 80 characters. This line is 84 characters.
last_resource_modified_date <- purrr::map_chr(content$result$resources, ~.$last_modified)

Check warning on line 26 in R/get_dataset_additional_info.R

View workflow job for this annotation

GitHub Actions / lint

file=R/get_dataset_additional_info.R,line=26,col=81,[line_length_linter] Lines should not be more than 80 characters. This line is 91 characters.
Expand All @@ -27,13 +29,11 @@ get_dataset_additional_info <- function(dataset_name){
most_recent_resource_date <- max(last_resource_modified_date, last_resource_created_date) %>%

Check warning on line 29 in R/get_dataset_additional_info.R

View workflow job for this annotation

GitHub Actions / lint

file=R/get_dataset_additional_info.R,line=29,col=81,[line_length_linter] Lines should not be more than 80 characters. This line is 95 characters.
as.POSIXct(format = "%FT%X", tz = "UTC")


#create tibble to return
return_value <- tibble::tibble("name" = dataset_name,
"amount_of_resources" = amount_of_resources,

Check warning on line 35 in R/get_dataset_additional_info.R

View workflow job for this annotation

GitHub Actions / lint

file=R/get_dataset_additional_info.R,line=35,col=25,[indentation_linter] Hanging indent should be 33 spaces but is 25 spaces.
"most_recent_resource_update" = most_recent_resource_date)

Check warning on line 36 in R/get_dataset_additional_info.R

View workflow job for this annotation

GitHub Actions / lint

file=R/get_dataset_additional_info.R,line=36,col=81,[line_length_linter] Lines should not be more than 80 characters. This line is 83 characters.

return(return_value)

}


5 changes: 1 addition & 4 deletions R/list_datasets.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,8 @@ list_datasets <- function() {

data_sets <- tibble::tibble("name" = unlist(data_sets))

return(data_sets)}




return(data_sets)}



0 comments on commit 4f608a4

Please sign in to comment.