mst.computation {mFD} | R Documentation |
Compute the Minimum Spanning Tree (MST) linking species of a given assemblage
Description
This function computes the MST linking species of a given assemblage and is used to compute FEve index.
Usage
mst.computation(sp_faxes_coord_k)
Arguments
sp_faxes_coord_k |
a matrix relating species coordinates for species present in a given assemblage. |
Value
A dist object summarizing the MST for all species of a given
assemblage mst_asb_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
# Compute the distance of "pear" to its nearest neighbor(s):
mst_fruits <- mst.computation(sp_faxes_coord_fruits)
mst_fruits
[Package mFD version 1.0.7 Index]