Description Details Super class Public fields Methods
HDX Resource
HDX Resource
HDX Resource, it contains all the logic for creating, checking, and updating resources
rhdx::HDXObject
-> HDXResource
data
placeholder for Resource field element
new()
Create a new Resource object
HDXResource$new(initial_data = NULL, configuration = NULL)
initial_data
list with required field to create a resource
configuration
a Configuration object
A new Resource object
download()
Download a HDX resource
HDXResource$download( folder = NULL, filename = NULL, quiet = TRUE, force = FALSE, ... )
folder
a character, folder to save the dataset
filename
a character, filename of the dataset
quiet
a logical value, silent download if TRUE
force
a logical value, force download
...
other download.file
parameters
a character, the file path
download_folder()
Get the download folder for the latest downloaded resource
HDXResource$download_folder()
a character, folder with the latest downloaded resource
read_resource()
Read a Resource object directly into memory
HDXResource$read_resource( sheet = NULL, layer = NULL, format = NULL, download_folder = NULL, simplify_json = TRUE, force_download = FALSE, quiet_download = TRUE, ... )
sheet
a character value, only for resource in Excel format
layer
a character value, only for spatial (vector) resource
format
a character value, file format;
download_folder
a character value, folder to save the downloaded resource
simplify_json
a logical value
force_download
a logical value, if TRUE force download
quiet_download
a logical value, if TRUE silent download
...
other parameters
a tibble
, a sf
, a stars
or a list
depending
on the type of resource read
get_layers()
Get spatial (vector) resource list of layers
HDXResource$get_layers( format = NULL, download_folder = NULL, quiet_download = TRUE, force_download = FALSE )
format
character; file format
download_folder
a character value, folder to save the downloaded resource
quiet_download
a logical value, if TRUE silent download
force_download
a logical value, if TRUE force download
a the list of layers available in the resource
get_sheets()
Get the list of sheets name of resource
HDXResource$get_sheets( format = NULL, download_folder = NULL, quiet_download = TRUE, force_download = FALSE )
format
character; file format
download_folder
a character value, folder to save the downloaded resource
quiet_download
a logical value, if TRUE silent download
force_download
a logical value, if TRUE force download
a the list of layers available in the resource
get_dataset()
Get the resource dataset.
HDXResource$get_dataset()
a Dataset, the dataset containing the resource
get_required_fields()
Get dataset required fields
HDXResource$get_required_fields()
list of required fields for a resource
check_required_field()
Check dataset required field
HDXResource$check_required_field(check_dataset_id = FALSE)
check_dataset_id
logical whether to check or not dataset id
a logical value, TRUE if the the resource is not missing a required field and throws an error otherwise
get_format()
Get the file format
HDXResource$get_format()
a character, the file format of the resource
as_list()
Get resource field into list
HDXResource$as_list()
a list with resource field
browse()
Browse the resource page on HDX
HDXResource$browse()
print()
Print a Resource object
HDXResource$print()
clone()
The objects of this class are cloneable with this method.
HDXResource$clone(deep = FALSE)
deep
Whether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.