sp.filter {mFD} | R Documentation |
Retrieve information about species in a given assemblage
Description
This function computes names of species present in an given assemblage,
their coordinates in the functional space and their weights. It is used in
the alpha_FD_multidim
function to filter species and compute each
functional indices for each community.
Usage
sp.filter(asb_nm, sp_faxes_coord, asb_sp_w)
Arguments
asb_nm |
a string object referring to the name of a given community. |
sp_faxes_coord |
a matrix of species coordinates in a chosen functional
space. Species coordinates have been retrieved thanks to
|
asb_sp_w |
a matrix linking weight of species (columns) and a set of assemblages (rows). |
Value
A vector containing names of species present in a given assemblage
sp_name_asb_k
, a matrix containing coordinates of species present
in a given assemblage sp_faxes_coord_k
, a matrix containing weight
of species present in a given assemblage asb_sp_w_k
, a matrix
containing relative weight of species present in a given assemblage
asb_sp_relatw_k
.
Author(s)
Camille Magneville and Sebastien Villeger
Examples
# Load Species*Traits dataframe:
data("fruits_traits", package = "mFD")
# Load Assemblages*Species dataframe:
data("baskets_fruits_weights", package = "mFD")
# Load Traits categories dataframe:
data("fruits_traits_cat", package = "mFD")
# Compute functional distance
sp_dist_fruits <- mFD::funct.dist(
sp_tr = fruits_traits,
tr_cat = fruits_traits_cat,
metric = "gower",
scale_euclid = "scale_center",
ordinal_var = "classic",
weight_type = "equal",
stop_if_NA = TRUE)
# Compute functional spaces quality to retrieve species coordinates matrix:
fspaces_quality_fruits <- mFD::quality.fspaces(
sp_dist = sp_dist_fruits,
maxdim_pcoa = 10,
deviation_weighting = "absolute",
fdist_scaling = FALSE,
fdendro = "average")
# Retrieve species coordinates matrix:
sp_faxes_coord_fruits <- fspaces_quality_fruits$details_fspaces$sp_pc_coord
# Filter species of basket_1 assemblage:
sp.filter(asb_nm = "basket_1",
sp_faxes_coord = sp_faxes_coord_fruits,
asb_sp_w = baskets_fruits_weights)