calcSpaceBetaDiv: SPATIAL BETA-DIVERSITY WRAPPER FUNCTION

calcSpaceBetaDivR Documentation

SPATIAL BETA-DIVERSITY WRAPPER FUNCTION

Description

This function loads and prepares networks to calculate temporal spp turnover (beta diversity) and saves the outputs. beta diversity is calculated per pairs of pixels of the same location, but different scenarios (a baseline/current scenario and a change scenario). this function was designed to be parallelized.

Usage

calcSpaceBetaDiv(
  ff,
  mode = "decomp",
  res.dir,
  out.dir,
  sampleNetworks = FALSE,
  noReps = NULL,
  networkGroups = NULL,
  parallel = FALSE,
  noCores = 2,
  toDo = "missing",
  cacheRepo = options("reproducible.cachePath"),
  ...
)

Arguments

ff

is the a file path to list of networks obtained from a scenario of change.

mode

can be either "decomp", to calculate beta-diversity as an alpha/gamma decomposition (using econetwork::divPartition), or "pairwise", to calculate pairwise beta-diversity between networks (using econetwork::disPairwise).

res.dir

is the "root" directory where "scenario networks" were stored

out.dir

is the directory where outputs will be saved

sampleNetworks

controls if beta-diversity is to be calculated for a sample of networks (provide integer) or all networks (FALSE)

noReps

determines number of reps for the sampling and calculating beta-diversity

networkGroups

groups of networks within which to calculate beta-diversity. If provided, it should be a named list of vectors of network IDs. Sampling will occur within each group, so beware of sample size.

parallel

activates parallel calculation of betadiv across samples. Uses future with plan(multiprocess)

noCores

only used in 'parallel' is TRUE. defaults to 2.

toDo

controls if beta-diversity has to be recalculated for 'all' scenarios or just 'missing' ones

cacheRepo

passed to reproducible::Cache.

...

further arguments passed to future::plan()


CeresBarros/ToolsCB documentation built on Aug. 23, 2024, 4:22 p.m.