Skip to contents

register_resource() is used to register a new resource function with base information to the package's internal environment used to inform users about available resources. Note, registering a custom resource will only have effect for the current R session.

available_resources() returns a tibble of registered resources with basic information such as the source and the licence.

Usage

register_resource(
  name = NULL,
  description = NULL,
  licence = NULL,
  source = NULL,
  type = NULL
)

available_resources(resources = NULL)

Arguments

name

A character vector indicating the name of the resource.

description

A character vector with a basic description

licence

A character vector indicating the licence of the resource. In case it is a custom licence, put a link to the licence text.

source

Optional, preferably a URL where the data is found.

type

A character vector indicating the type of the resource. Either 'vector' or 'raster'.

resources

If NULL returns a list of all resources (default). Otherwise only the ones specified.

Value

register_resource() is called for the side-effect of registering a resource.

available_resources() returns a tibble listing available resources.

Examples

# \dontrun{
register_resource(
  name = "gfw_treecover",
  description = "Global Forest Watch - Percentage of canopy closure in 2000",
  licence = "CC-BY 4.0",
  source = "https://data.globalforestwatch.org/documents/tree-cover-2000/explore",
  type = "raster"
)
# }
available_resources()
#> # A tibble: 24 × 5
#>    name                            description              licence source type 
#>    <chr>                           <chr>                    <chr>   <chr>  <chr>
#>  1 chirps                          Climate Hazards Group I… CC - u… https… rast…
#>  2 esalandcover                    Copernicus Land Monitor… CC-BY … https… rast…
#>  3 fritz_et_al                     Drivers of deforestatio… CC-BY … https… rast…
#>  4 gfw_emissions                   Global Forest Watch - C… CC-BY … https… rast…
#>  5 gfw_lossyear                    Global Forest Watch - Y… CC-BY … https… rast…
#>  6 gfw_treecover                   Global Forest Watch - P… CC-BY … https… rast…
#>  7 gfw_treecover                   Global Forest Watch - P… CC-BY … https… rast…
#>  8 global_surface_water_change     Global Surface Water - … https:… https… rast…
#>  9 global_surface_water_occurrence Global Surface Water - … https:… https… rast…
#> 10 global_surface_water_recurrence Global Surface Water - … https:… https… rast…
#> # ℹ 14 more rows