R/SAVE_FATE.step1_PFG.R
SAVE_FATE.step1_PFG.RdThis 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
)a string corresponding to the name to give to
archive folder
a data.frame with at least 3 columns : sites, species, abund (and optionally,
habitat) (see PRE_FATE.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).
a data.frame with at least 3 columns :
species, GROUP, ... (one column for each functional
trait)
(see PRE_FATE.speciesDistance)
(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)
(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).
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.
(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.
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)
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.
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.
A list containing all the elements given to the function and
checked :
name of the dataset
(see PRE_FATE.selectDominant)
sitesname of sampling site
(x, y)coordinates of sampling site
speciesname of the concerned species
abundabundance of the concerned species
(habitat)habitat of sampling site
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)
(see PRE_FATE.speciesDistance)
speciesname of the concerned species
GROUPname of the concerned data subset
...one column for each functional trait
a dist object corresponding to the distance
between each pair of species in terms of niche overlap (see
PRE_FATE.speciesDistance)
a vector containing values for the
parameters opt.maxPercent.NA, opt.maxPercent.similarSpecies,
opt.min.sd (see PRE_FATE.speciesDistance)
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)
(see PRE_FATE.speciesClustering_step1)
GROUPname of data subset
no.clustersnumber of clusters used for the clustering
variableevaluation metrics' name
valuevalue of evaluation metric
number of clusters to be kept for each data subset
(see PRE_FATE.speciesClustering_step2)
PFGID of the plant functional group
(GROUP + ID.cluster)
GROUPname of data subset
ID.clustercluster number
speciesname of species
ID.speciesspecies number in each PFG
DETERMINANTTRUE 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
(see PRE_FATE.speciesClustering_step3)
PFGname of the concerned functional group
no.speciesnumber 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.
## Load example data