Skip to contents

Get Open Data resources from a dataset

Usage

get_dataset(
  dataset_name,
  max_resources = NULL,
  rows = NULL,
  include_context = FALSE
)

Arguments

dataset_name

name of the dataset as found on NHS Open Data platform

max_resources

(optional) the maximum number of resources to return, use for testing code, it will return the n latest resources

rows

(optional) specify the max number of rows to return for each resource.

include_context

(optional) If TRUE additional information about the resource will be added as columns to the data, including the resource ID, the resource name, the creation date and the last modified/updated date.

Value

a tibble with the data

See also

get_resource() for downloading a single resource from a dataset.

Examples

get_dataset("gp-practice-populations",
  max_resources = 2, rows = 10
)
#> # A tibble: 20 × 24
#>        Date PracticeCode HB        HSCP   Sex   SexQF AllAges AllAgesQF Ages0to4
#>       <int>        <int> <chr>     <chr>  <chr> <chr>   <int> <chr>        <int>
#>  1 20240701        10002 S08000030 S3700… Male  ""       4072 ""             179
#>  2 20240701        10002 S08000030 S3700… Fema… ""       4188 ""             175
#>  3 20240701        10002 S08000030 S3700… All   "d"      8260 ""             354
#>  4 20240701        10017 S08000030 S3700… Male  ""       3697 ""             136
#>  5 20240701        10017 S08000030 S3700… Fema… ""       3657 ""             116
#>  6 20240701        10017 S08000030 S3700… All   "d"      7354 ""             252
#>  7 20240701        10036 S08000030 S3700… Male  ""       2449 ""              94
#>  8 20240701        10036 S08000030 S3700… Fema… ""       2407 ""              55
#>  9 20240701        10036 S08000030 S3700… All   "d"      4856 ""             149
#> 10 20240701        10106 S08000030 S3700… Male  ""       3100 ""              92
#> 11 20240401        10002 S08000030 S3700… Male  ""       4056 ""             186
#> 12 20240401        10002 S08000030 S3700… Fema… ""       4195 ""             176
#> 13 20240401        10002 S08000030 S3700… All   "d"      8251 ""             362
#> 14 20240401        10017 S08000030 S3700… Male  ""       3652 ""             134
#> 15 20240401        10017 S08000030 S3700… Fema… ""       3620 ""             115
#> 16 20240401        10017 S08000030 S3700… All   "d"      7272 ""             249
#> 17 20240401        10036 S08000030 S3700… Male  ""       2437 ""              99
#> 18 20240401        10036 S08000030 S3700… Fema… ""       2406 ""              53
#> 19 20240401        10036 S08000030 S3700… All   "d"      4843 ""             152
#> 20 20240401        10106 S08000030 S3700… Male  ""       3095 ""              93
#> # ℹ 15 more variables: Ages0To4QF <chr>, Ages5to14 <int>, Ages5To14QF <chr>,
#> #   Ages15to24 <int>, Ages15To24QF <chr>, Ages25to44 <int>, Ages25To44QF <chr>,
#> #   Ages45to64 <int>, Ages45To64QF <chr>, Ages65to74 <int>, Ages65To74QF <chr>,
#> #   Ages75to84 <int>, Ages75To84QF <chr>, Ages85plus <int>, Ages85PlusQF <chr>