tr.cont.fspace {mFD} | R Documentation |
Build a functional space based on continuous traits only
Description
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.
Usage
tr.cont.fspace(
sp_tr,
pca = TRUE,
nb_dim = 7,
scaling = "scale_center",
compute_corr = "pearson"
)
Arguments
sp_tr |
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). |
pca |
a logical value. If |
nb_dim |
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 |
scaling |
a string value to compute (or not) scaling of traits using
the |
compute_corr |
a string value to compute Pearson correlation
coefficients between traits ( |
Value
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).
Author(s)
Camille Magneville and Sebastien Villeger
Examples
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')