hill_func: Functional diversity through Hill Numbers

View source: R/hill_func.R

hill_funcR Documentation

Functional diversity through Hill Numbers

Description

Calculate functional diversity for each site (alpha diversity).

Usage

hill_func(
  comm,
  traits,
  traits_as_is = FALSE,
  q = 0,
  base = exp(1),
  check_data = TRUE,
  div_by_sp = FALSE,
  ord = c("podani", "metric"),
  fdis = TRUE,
  stand_dij = FALSE
)

Arguments

comm

A data frame of vegetation data. Sites as rows, species as columns.

traits

A data frame of species functional traits data. Species as rows, traits as columns. It can include both continuous and categorical data. It will be transformed into a distance matrix using 'FD::gowdis(traits)'. If all traits are numeric, then it will use Euclidean distance.

traits_as_is

if FALSE (default) traits data frame will be transformed into a distance matrix. Otherwise, will use as is (i.e. traits is a symmetric distance matrix).

q

Hill number, q = 0 (default) to get species richness, q = 1 to get shannon entropy, q = 2 will give inverse Simpson.

base

default is exp(1), the base of log.

check_data

whether to check data first? Default is TRUE.

div_by_sp

as FD calculated in this way will be highly correlated with taxonomic diversity, one potential simple way to correct this is to divide the results by the number of species. However, a more common way to deal with correlations is to use null models and calculate standardized effect sizes. Therefore, I set the default to be FALSE.

ord

ord in FD::gowdis.

fdis

whether to calculate FDis, default is TRUE

stand_dij

whether to standardize distance matrix to have max value of 1? Default is FALSE.

Value

A matrix, with these information for each site: Q (Rao's Q); D_q (functional hill number, the effective number of equally abundant and functionally equally distinct species); MD_q (mean functional diversity per species, the effective sum of pairwise distances between a fixed species and all other species); FD_q (total functional diversity, the effective total functional distance between species of the assemblage). See Chiu and Chao 2014 page 4 for more information.

References

Chao, Anne, Chun-Huo Chiu, and Lou Jost. Unifying Species Diversity, Phylogenetic Diversity, Functional Diversity, and Related Similarity and Differentiation Measures Through Hill Numbers. Annual Review of Ecology, Evolution, and Systematics 45, no. 1 (2014): 297–324. <doi:10.1146/annurev-ecolsys-120213-091540>.

Chiu, Chun-Huo, and Anne Chao. Distance-Based Functional Diversity Measures and Their Decomposition: A Framework Based on Hill Numbers. PLoS ONE 9, no. 7 (July 7, 2014): e100014. <doi:10.1371/journal.pone.0100014>.

Examples

dummy = FD::dummy
hill_func(comm = dummy$abun, traits = dummy$trait, q = 0)
hill_func(comm = dummy$abun, traits = dummy$trait, q = 1)
hill_func(comm = dummy$abun, traits = dummy$trait, q = 0.9999)
hill_func(comm = dummy$abun, traits = dummy$trait, q = 2)
hill_func(comm = dummy$abun, traits = dummy$trait, q = 3)


daijiang/hillR documentation built on Aug. 20, 2023, 4:25 a.m.