This function computes a functional space based on continuous standardized
traits or continuous raw traits matrix. User can either choose to compute
functional space based on PCA analysis or using one trait for one functional
axis. For PCA analysis, center and scale arguments are considered FALSE
:
if you want to center, scale or standardize by any mean your data, please
use tr.cont.scale
function. Option makes it possible to
compute correlation between traits.
tr.cont.fspace(
sp_tr,
pca = TRUE,
nb_dim = 7,
scaling = "scale_center",
compute_corr = "pearson"
)
A list containing a matrix with mAD
and mSD
values for each
functional space to assess the quality of functional spaces), a matrix
containing eigenvalues for each axis, the percentage of variance explained
by each axis and the cumulative percentage of variance, a data frame
containing species coordinates on each functional axis, list of distance
matrices in the functional space (Euclidean distances based on trait values
and coordinates in the functional spaces), a dist object containing initial
euclidean distances based on traits and a matrix of correlation coefficients
between traits (if required).
a data frame of traits values (columns) for each species (rows). Note that species names must be specified in the row names and traits must be continuous (raw or standardized).
a logical value. If TRUE
a PCA analysis is computed, elsewhere
the functional space is computed with one trait for each dimension.
Default is TRUE
.
an integer referring to the maximum number of dimensions for
multidimensional functional spaces. Final number of dimensions depends
on the number of positive eigenvalues obtained with the PCA. High value
for nb_dim
can increase computation time. Default is nb_dim = 7
.
a string value to compute (or not) scaling of traits using
the tr.cont.scale
function. Possible options are:
range
(standardize by the range),
center
(use the center transformation: \(x' = x - mean(x)\)),
scale
(use the scale transformation: \(x' = \frac{x}{sd(x)}\)),
scale_center
(use the scale-center transformation:
\(x' = \frac{x - mean(x)}{sd(x)}\)), or
no_scale
Default is scale_center
.
a string value to compute Pearson correlation
coefficients between traits (compute_corr = 'pearson'
). You can choose
not to compute correlation coefficient by setting compute_corr
to
none
.
Camille Magneville and Sebastien Villeger
load(system.file('extdata', 'sp_tr_cestes_df', package = 'mFD'))
mFD::tr.cont.fspace(
sp_tr = sp_tr,
pca = TRUE,
nb_dim = 7,
scaling = 'scale_center',
compute_corr = 'pearson')
Run the code above in your browser using DataLab