This function estimates functional diversity using various methods and allows for randomization to obtain null distributions. This function is a wrapper for the melodic adapted from https://doi.org/10.1007/s00442-016-3546-0.

diversity_estimate_functional(
  data_source_community,
  data_source_traits,
  sel_method = c("rao", "mpd", "simpson"),
  abundance_weighted = TRUE,
  rand = 1000
)

Arguments

data_source_community

Data matrix. Rows as levels and columns as taxa. Row names should be the sample_id.

data_source_traits

Data frame. Row names be the same taxa as in data_source_community and vice versa.

sel_method

Selected method for diversity estimation:

  • "rao" - Rao's quadratic diversity

  • "mpd" = Mean Pairwise Distance

  • "simpson" = Simpsons Diversity Index

abundance_weighted

Logical. A value indicating whether or not the calculation should be abundance-weighted (TRUE) or presence/absence-based (FALSE).

rand

Numeric. An integer specifying the number of randomizations to perform to obtain null distributions

Value

Data frame with diversity metric estimated for each level (sample). Possible outputs depending on the sel_method:

  • fd_rao - Rao's quadratic diversity

  • fd_mpd - Mean Pairwise Distance

  • fd_simpson - Simpsons Diversity Index

  • z_score - Standarise Effect Size (SES), calculated as (observed value - mean randomised value ) / sd of randomised value

Author

Triin Reitalu, Ondrej Mottl