Downloads files for a specified NHS TRUD item. By default this downloads
the latest release. Use the item numbers from trud_items() or
get_subscribed_metadata().
Subscription Required
You must subscribe to TRUD items individually through the NHS TRUD website
before you can access them using get_item_metadata() or download_item().
Simply having an API key is not sufficient. To see items you're already
subscribed to, use get_subscribed_metadata(). To browse all available
items, use trud_items().
download_item(
item,
directory = ".",
file_type = c("archive", "checksum", "signature", "publicKey"),
release = NULL,
overwrite = FALSE
)The file path to the downloaded file, returned invisibly.
An integer, the item to be downloaded. Get these from trud_items()
or get_subscribed_metadata().
Path to the directory to which this item will be downloaded to. This is set to the current working directory by default.
The type of file to download. Options are "archive" (the
main release file), "checksum", "signature", or "publicKey". Defaults
to "archive".
The release ID to be downloaded. Release IDs are found in the
id field of each release from get_item_metadata(). If NULL (default),
the latest item release will be downloaded.
If TRUE, existing files will be overwritten. If FALSE
(default), existing files will be skipped and the function will return the
existing file path.
To download a specific (non-latest) release:
Use get_item_metadata() with release_scope = "all" to retrieve metadata for all releases
The release IDs are stored under the id item for each release
Pass the desired release ID to the release parameter of download_item()
trud_items() to find item numbers
get_subscribed_metadata() to see items you can access
get_item_metadata() to explore available releases before downloading