PRE_FATE.speciesClustering_step2: Choose clusters and select determinant species

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/PRE_FATE.speciesClustering_step2.R

Description

This script is designed to obtain functional groups by : 1) selecting the number of clusters to be kept from an object obtained with the PRE_FATE.speciesClustering_step1 function ; 2) refining these groups by identifying determinant species in each of them.

Usage

1
2
3
4
5
PRE_FATE.speciesClustering_step2(
  clust.dendrograms,
  no.clusters,
  mat.species.DIST
)

Arguments

clust.dendrograms

a dendrogram, or a list of dendrograms (one for each GROUP 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

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.

Details

This function allows to obtain a classification of dominant species into Plant Functional Groups (PFG), and the determinant species based on these PFG.

What is the difference between dominant and determinant species ?

Value

A list containing one vector, one data.frame with the following columns, and two ggplot2 objects :

determ.sp

the names of all determinant species

determ.all

(determinant and non-determinant species)

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

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

DETERMINANT

TRUE if determinant species, FALSE otherwise

plot.distance

ggplot2 object, representing the distribution of mean distances between species for each functional group

plot.PCO

list of ggplot2 objects, representing the PFG within the functional space

One ‘PRE_FATE_CLUSTERING_STEP_2_distantSpecies_PCO.pdf’ file is created containing two types of graphics :

distantSpecies

to visualize in each PFG the distribution of mean distance of each species to other species, and non-determinant species which are outside the distribution

PCO

to visualize in each PFG the distribution of species, with and without non-determinant species

Author(s)

Maya Guéguen

See Also

cutree, quasieuclid, dudi.pco, PRE_FATE.speciesDistance, PRE_FATE.speciesClustering_step1, PRE_FATE.speciesClustering_step3

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
## Load example data
data(DATASET_Bauges_PFG)

## Species dissimilarity distance (niche overlap + traits distance)
tab.dist = DATASET_Bauges_PFG$dom.dist_total
str(tab.dist)
as.matrix(tab.dist[[1]])[1:5, 1:5]


## Build dendrograms -------------------------------------------------------------------------
sp.CLUST = PRE_FATE.speciesClustering_step1(mat.species.DIST = tab.dist)
names(sp.CLUST)


## Number of clusters per group
plot(sp.CLUST$plot.clustNo)
no.clusters = c(5, 5, 9)

## Find determinant species ------------------------------------------------------------------
sp.DETERM = PRE_FATE.speciesClustering_step2(clust.dendrograms = sp.CLUST$clust.dendrograms
                                             , no.clusters = no.clusters
                                             , mat.species.DIST = tab.dist)
names(sp.DETERM)

str(sp.DETERM$determ.sp)
str(sp.DETERM$determ.all)

## Species names
sp.NAMES = DATASET_Bauges_PFG$sp.names
sp.NAMES$species = paste0("X", sp.NAMES$species)
determ = merge(sp.DETERM$determ.all, sp.NAMES, by = "species", all.x = TRUE)
str(determ)

plot(sp.DETERM$plot.distance)
plot(sp.DETERM$plot.PCO$Chamaephyte)
plot(sp.DETERM$plot.PCO$Herbaceous)
plot(sp.DETERM$plot.PCO$Phanerophyte)

MayaGueguen/RFate documentation built on Oct. 17, 2020, 8:06 a.m.