
Get metadata for subscribed NHS TRUD items
Source:R/get_subscribed_metadata.R
get_subscribed_metadata.RdA convenience wrapper around trud_items() and get_item_metadata(),
retrieving metadata for only items that the user is subscribed to. This is
particularly useful for seeing what data you can download with download_item().
If you need access to additional items, browse available options with
trud_items(), then subscribe through the NHS TRUD website.
Usage
get_subscribed_metadata(release_scope = c("all", "latest"))Value
A tibble, with item metadata stored in the list column metadata.
Use the item_number column values with download_item().
See also
trud_items()to browse all available itemsget_item_metadata()for detailed metadata on specific itemsdownload_item()to download items you're subscribed to
Examples
if (FALSE) { # identical(Sys.getenv("IN_PKGDOWN"), "true") & Sys.getenv("TRUD_API_KEY") != ""
# Get metadata for all subscribed items
subscribed <- get_subscribed_metadata()
# Show structure without exposing API keys in URLs
subscribed$metadata[[1]] |>
purrr::map_at("releases", \(release) purrr::map(release, names))
}