alpha.fd.multidim {mFD}R Documentation

Compute a set of alpha functional indices for a set of assemblages

Description

This function computes a set of multidimensional space based indices of alpha functional diversity. The user can choose which functional indices to compute.

Usage

alpha.fd.multidim(
  sp_faxes_coord,
  asb_sp_w,
  ind_vect = c("fide", "fdis", "fmpd", "fnnd", "feve", "fric", "fdiv", "fori", "fspe"),
  scaling = TRUE,
  check_input = TRUE,
  details_returned = TRUE,
  verbose = TRUE
)

Arguments

sp_faxes_coord

a matrix of species coordinates in a chosen functional space. Species coordinates have been retrieved thanks to tr.cont.fspace or quality.fspaces.

asb_sp_w

a matrix linking weight of species (columns) and a set of assemblages (rows).

ind_vect

a vector of character string of the name of functional indices to compute. Indices names must be written in lower case letters. Possible indices to compute are: 'fide', fdis', 'fmpd', 'fnnd', 'feve', 'fric', 'fdiv', 'fori' and 'fspe'. Default: all the indices are computed.

scaling

a logical value indicating if scaling is to be done (TRUE) or not (FALSE) on functional indices. Scaling is used to be able to compare indices values between assemblages. Default: scaling = TRUE.

check_input

a logical value indicating whether key features the inputs are checked (e.g. class and/or mode of objects, names of rows and/or columns, missing values). If an error is detected, a detailed message is returned. Default: check.input = TRUE.

details_returned

a logical value indicating whether the user want to store details. Details are used in graphical functions and thus must be kept if the user want to have graphical outputs for the computed indices.

verbose

a logical value indicating whether progress details should be printed in the console. If FALSE does not provide percent progress when computing diversity indices.

Value

The following list is returned:

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 alpha diversity indices
alpha_fd_indices_fruits <- mFD::alpha.fd.multidim(
  sp_faxes_coord   = sp_faxes_coord_fruits[, c('PC1', 'PC2', 'PC3', 'PC4')],
  asb_sp_w         = baskets_fruits_weights, 
  ind_vect         = c('fdis', 'fmpd', 'fnnd', 'feve', 'fric', 'fdiv', 
                       'fori', 'fspe'),
  scaling          = TRUE, 
  check_input      = TRUE, 
  details_returned = TRUE)
  
# Retrieve alpha diversity indices table
fd_ind_values_fruits <- alpha_fd_indices_fruits$functional_diversity_indices
fd_ind_values_fruits

[Package mFD version 1.0.7 Index]