Initialization of a biodiversity portfolio objectSource:
This function expects an
sf object as its first argument that contains
only geometry of type
MULTIPOLYGON. Each row of the
object is considered a single asset in the portfolio for which biodiversity
indicators will be calculated further down the processing chain. Some
preliminary checks are conducted, e.g. that the CRS of the object is
EPSG:4326 otherwise it will be transformed. Some portfolio wide parameters
such as the output directory for downloaded data sets, a temporal directory
for intermediate calculation of the number of cores available for the
indicator calculation can be set by the user to have more fine-control of
the workflow. However, these parameters are also set to sensible defaults
and thus can be omitted during portfolio initialization.
init_portfolio( x, years, outdir = getwd(), tmpdir = tempdir(), cores = parallel::detectCores() - 1, add_resources = TRUE, aria_bin = NULL, verbose = TRUE )
The sf object to be transformed to a portfolio
Numeric vector for time frame of the analysis handed over as a vector of consecutive years
Character indicating the directory where resources will be written to. If the directory does not exist, we will attempt to create it. The output director cannot be equal to the temporary directory. Defaults to the current working directory.
Character vector to a directory used for intermediate files. Defaults to the output of
tempdir(), e.g. the current R session's temporal directory. If a custom file path does not exist, we will attempt to create it. Cannot be equal to the output directory. Note, that for raster calculations we will set the temporal directory for the
terrapackage here. Please make sure that enough disk space is available because some intermediate calculations can become quite large.
An integer value indicating the number of cores on the host machine available for indicator calculation. It defaults to
parallel::detectCores() - 1cores, i.e. one core less than all available cores.
Logical if existing resources in 'outdir' should be added to the portfolio. Defaults to TRUE. Setting it to FALSE can be of use e.g. if a previous download has terminated unexpectedly in order to resume.
A character vector to an aria2c executable for parallel downloads
Logical, defaults to TRUE, indicating if progress information is printed.