govcan_dl_resources {rgovcan} | R Documentation |
Download the resources attached to a specific record or (i.e. a CKAN package) or to a stack of packages
Description
Download resources attached to a specific record or (i.e. a CKAN package) or to a stack of packages.
Usage
govcan_dl_resources(resources, excluded, included, path, id_as_filename, ...)
## S3 method for class 'ckan_resource'
govcan_dl_resources(
resources,
excluded = NULL,
included = NULL,
path = ".",
id_as_filename = FALSE,
...
)
## S3 method for class 'ckan_resource_stack'
govcan_dl_resources(resources, ...)
## S3 method for class 'character'
govcan_dl_resources(resources, ...)
## S3 method for class 'ckan_package'
govcan_dl_resources(resources, ...)
## S3 method for class 'ckan_package_stack'
govcan_dl_resources(resources, ...)
Arguments
resources |
An object of class |
excluded |
(vector of characters) Files of this format(s) will not be
downloaded ( |
included |
(vector of characters) Only the files of this format(s) will
be downloaded ( |
path |
(character) name indicating where to store the data (default is the current working directory). |
id_as_filename |
(logical) Use the resource identifier as file name. This is particularly useful when two different resources have the same filename. |
... |
Curl arguments passed on to crul::verb-GET (see |
Details
File names are handled internally.
Value
A tibble of the download metadata (file id, package id, url, download path, format, storage location, associated data).
Methods (by class)
-
ckan_resource
: Method for ckan_resource objects. -
ckan_resource_stack
: Method forckan_resource_stack
objects. -
character
: Method forcharacter
objects. -
ckan_package
: Method forckan_package
objects. -
ckan_package_stack
: Method forckan_package_stack
objects.
Examples
## Not run:
id <- "b7ca71fa-6265-46e7-a73c-344ded9212b0"
dir <- tempdir(check = TRUE)
res <- govcan_dl_resources(id, path = dir)
## End(Not run)