This script is designed to gather all data and parameters used to build a set of Plant Functional Groups.

SAVE_FATE.step1_PFG(
  name.dataset,
  mat.observations,
  rules.selectDominant = c(doRuleA = NA, rule.A1 = NA, rule.A2_quantile = NA, doRuleB =
    NA, rule.B1_percentage = NA, rule.B1_number = NA, rule.B2 = NA, doRuleC = NA),
  mat.traits,
  mat.overlap = NA,
  rules.speciesDistance = c(opt.maxPercent.NA = NA, opt.maxPercent.similarSpecies = NA,
    opt.min.sd = NA),
  mat.species.DIST,
  clust.evaluation = NA,
  no.clusters,
  determ.all,
  mat.traits.PFG
)

Arguments

name.dataset

a string corresponding to the name to give to archive folder

mat.observations

a data.frame with at least 3 columns :
sites, species, abund (and optionally, habitat) (see PRE_FATE.selectDominant)

rules.selectDominant

(optional) default NA.
A vector containing all the parameter values given to the PRE_FATE.selectDominant function, if used (doRuleA, rule.A1, rule.A2_quantile, doRuleB, rule.B1_percentage, rule.B1_number, rule.B2, doRuleC).

mat.traits

a data.frame with at least 3 columns : species, GROUP, ... (one column for each functional trait)
(see PRE_FATE.speciesDistance)

mat.overlap

(optional) default NA.
Otherwise, two options :

  • a data.frame with 2 columns : species, raster

  • a dissimilarity structure representing the niche overlap between each pair of species.
    It can be a dist object, a niolap object, or simply a matrix.

(see PRE_FATE.speciesDistance)

rules.speciesDistance

(optional) default NA.
A vector containing all the parameter values given to the PRE_FATE.speciesDistance function, if used
( opt.maxPercent.NA, opt.maxPercent.similarSpecies, opt.min.sd).

mat.species.DIST

a dist object, or a list of dist objects (one for each GROUP value), corresponding to the distance between each pair of species.
Such an object can be obtained with the PRE_FATE.speciesDistance function.

clust.evaluation

(optional) default NA.
A data.frame with 4 columns :
GROUP, no.clusters, variable, value.
Such an object can be obtained with the PRE_FATE.speciesClustering_step1 function.

no.clusters

an integer, or a vector of integer (one for each GROUP value), with the number of clusters to be kept (see PRE_FATE.speciesClustering_step2)

determ.all

a data.frame with 6 or 10 columns :
PFG, GROUP, ID.cluster, species, ID.species, DETERMINANT
(and optionally, sp.mean.dist, allSp.mean, allSp.min, allSp.max).
Such an object can be obtained with the PRE_FATE.speciesClustering_step2 function.

mat.traits.PFG

a data.frame with at least 3 columns : PFG, no.species, ... (one column for each functional trait, computed as the mean (for numeric traits) or the median (for categorical traits) of the values of the determinant species of this PFG).
Such an object can be obtained with the PRE_FATE.speciesClustering_step3 function.

Value

A list containing all the elements given to the function and checked :

name.dataset

name of the dataset

mat.observations

(see PRE_FATE.selectDominant)

sites

name of sampling site

(x, y)

coordinates of sampling site

species

name of the concerned species

abund

abundance of the concerned species

(habitat)

habitat of sampling site

rules.selectDominant

a vector containing values for the parameters doRuleA, rule.A1, rule.A2_quantile, doRuleB, rule.B1_percentage, rule.B1_number, rule.B2, doRuleC (see PRE_FATE.selectDominant)

mat.traits

(see PRE_FATE.speciesDistance)

species

name of the concerned species

GROUP

name of the concerned data subset

...

one column for each functional trait

mat.overlap

a dist object corresponding to the distance between each pair of species in terms of niche overlap (see PRE_FATE.speciesDistance)

rules.speciesDistance

a vector containing values for the parameters opt.maxPercent.NA, opt.maxPercent.similarSpecies, opt.min.sd (see PRE_FATE.speciesDistance)

mat.species.DIST

a dist object corresponding to the distance between each pair of species, or a list of dist objects, one for each GROUP value (see PRE_FATE.speciesDistance)

clust.evaluation

(see PRE_FATE.speciesClustering_step1)

GROUP

name of data subset

no.clusters

number of clusters used for the clustering

variable

evaluation metrics' name

value

value of evaluation metric

no.clusters

number of clusters to be kept for each data subset

determ.all

(see PRE_FATE.speciesClustering_step2)

PFG

ID of the plant functional group (GROUP + ID.cluster)

GROUP

name of data subset

ID.cluster

cluster number

species

name of species

ID.species

species number in each PFG

DETERMINANT

TRUE if determinant species, FALSE otherwise

(sp.mean.dist)

species mean distance to other species of the same PFG

(allSp.mean)

\(mean(\text{sp.mean.dist})\) within the PFG

(allSp.min)

\(mean(\text{sp.mean.dist}) - 1.64 * sd(\text{sp.mean.dist})\) within the PFG

(allSp.max)

\(mean(\text{sp.mean.dist}) + 1.64 * sd(\text{sp.mean.dist})\) within the PFG

mat.traits.PFG

(see PRE_FATE.speciesClustering_step3)

PFG

name of the concerned functional group

no.species

number of species in the concerned PFG

...

one column for each functional trait

The information is written in FATE_dataset_[name.dataset]_step1_PFG.RData file.

Author

Maya Guéguen

Examples


## Load example data