Skip to contents

mapme_options() sets default options for mapme.biodiversity to control the behavior of downstream functions. Mainly, the output path as well as the temporal directory for intermediate files can be set. Additionally, the verbosity can be set. The testing options should not be set by users, as it controls the behavior of the package during automated test pipelines. Might be extended by other options in the future.

get_resources() data sets required for the calculation of indicators can be made available. The function supports the specification of several resource functions. To determine the output path, temporary directory and verbosity, the output of mapme_options() is used.

calc_indicators() calculates specific biodiversity indicators. A requirement is that the resources that are mandatory inputs for the requested indicators are available locally. Multiple indicators and their respective additional arguments can be supplied.

Usage

mapme_options(..., outdir, verbose, aria_bin, testing)

get_resources(x, ...)

calc_indicators(x, ...)

Arguments

...

One or more functions for resources/indicators

outdir

A length one character indicating the output path.

verbose

A logical, indicating if informative messages should be printed.

aria_bin

A character vector to an aria2c executable for parallel downloads.

testing

A logical. Not to be set by users. Controls the behavior during automated test pipelines.

x

An sf object with features of type "POLYGON"

Value

mapme_options() returns a list of options if no arguments are specified. Otherwise sets matching arguments to new values in the package's internal environment.

get_resources() is called for its side effect of making resources available in the package environment. Returns x, invisibly.

calc_indicators() returns x, invisibly, with an additional nested list column per requested indicator.

Examples

library(mapme.biodiversity)
mapme_options()
#> $outdir
#> [1] "/tmp/Rtmp7HVIWG/mapme-data"
#> 
#> $verbose
#> [1] FALSE
#> 
#> $aria_bin
#> NULL
#> 
#> $testing
#> [1] FALSE
#>