MyNixOS website logo
Description

Easy Computation of Functional Diversity Indices.

Computes six functional diversity indices. These are namely, Functional Divergence (FDiv), Function Evenness (FEve), Functional Richness (FRic), Functional Richness intersections (FRic_intersect), Functional Dispersion (FDis), and Rao's entropy (Q) (reviewed in Villéger et al. 2008 <doi:10.1890/07-1206.1>). Provides efficient, modular, and parallel functions to compute functional diversity indices (preprint: <doi:10.32942/osf.io/dg7hw>).

fundiversity fundiversity logo

Lifecycle:stable R buildstatus CoverageStatus CRANstatus DOI

fundiversity provides a lightweight package to compute common functional diversity indices. To a get a glimpse of what fundiversity can do refer to the introductory vignette. The package is built using clear, public design principles inspired from our own experience and user feedback.

Installation

You can install the stable version from CRAN with:

install.packages("fundiversity")

Alternatively, you can install the development version with:

install.packages("fundiversity", repos = "https://bisaloo.r-universe.dev")

Examples

fundiversity lets you compute six functional diversity indices: Functional Richness with fd_fric(), intersection with between convex hulls with fd_fric_intersect(), Functional Divergence with fd_fdiv(), Rao’s Quadratic Entropy with fd_raoq(), Functional Dispersion with fd_fdis() and Functional Evenness with fd_feve(). You can have a brief overview of the indices in the introductory vignette.

All indices can be computed either using global trait data or at the site-level:

library("fundiversity")

# If only the trait dataset is specified, considers all species together
# by default
fd_fric(traits_birds)
#>   site     FRic
#> 1   s1 230967.7

# We can also compute diversity across sites
fd_fric(traits_birds, site_sp_birds)
#>        site       FRic
#> 1  elev_250 171543.730
#> 2  elev_500 185612.548
#> 3 elev_1000 112600.176
#> 4 elev_1500  66142.748
#> 5 elev_2000  20065.764
#> 6 elev_2500  18301.176
#> 7 elev_3000  17530.651
#> 8 elev_3500   3708.735

To compute Rao’s Quadratic Entropy, the user can also provide a distance matrix between species directly:

dist_traits_birds = as.matrix(dist(traits_birds))

fd_raoq(traits = NULL, dist_matrix = dist_traits_birds)
#>   site        Q
#> 1   s1 170.0519

Function Summary

Function NameIndex NameParallelizable[^1]Memoizable[^2]
fd_fric()FRic
fd_fric_intersect()FRic_intersect
fd_fdiv()FDiv
fd_feve()FEve
fd_fdis()FDis
fd_raoq()Rao’s Q

Parallelization

Thanks to the future.apply package, all functions (except fd_raoq()) within fundiversity support parallelization through the future backend. To toggle parallelization follow the future syntax:

future::plan(future::multisession)
fd_fdiv(traits_birds)
#>   site      FDiv
#> 1   s1 0.7282172

For more details please refer to the parallelization vignette or use vignette("fundiversity_1-parallel", package = "fundiversity") within R.

Available functional diversity indices

According to Pavoine & Bonsall (2011) classification, functional diversity indices can be classified in three “domains” that assess different properties of the functional space: richness, divergence, and regularity. We made sure that the computations in the package are correct in our correctness vignette. fundiversity provides function to compute indices that assess this three facets at the site scale:

ScaleRichnessDivergenceEvenness
α-diversity
(= among sites)
FRic with fd_fric()FDiv with fd_fdiv()
Rao’s QE with fd_raoq()
FDis with fd_fdis()
FEve with fd_feve()
β-diversity
(= between sites)
FRic pairwise intersection with fd_fric_intersect()
alternatives available in betapart
available in entropart, betapart or hillRavailable in BAT

Related Packages

Several other packages exist that compute functional diversity indices. We did a performance comparison between related packages. We here mention some of them (but do not mention the numerous wrappers around these packages):

Package NameIndices includedHas vignettesHas testsOn GitHubOn CRAN (last updated)
adivFunctional Entropy, Functional Redundancy
BATβ-diversity indices, Richness, divergence, and evenness with hypervolumes
betapartFunctional β-diversity
entropartFunctional Entropy
FDFRic, FDiv, FDis, FEve, Rao’s QE, Functional Group Richness
hilldivDendrogram-based Hill numbers for functional diversity
hillRFunctional Diversity Hill Numbers
hypervolumeHypervolume measure of functional diversity (~FRic)
mFDFunctional α- and β-diversity indices, including FRic, FDiv, FDis, FEve, FIde, FMPD, FNND, FOri, FSpe, Hill Numbers
TPDFRic, FDiv, FEve but for probability distributions
veganOnly dendrogram-based FD (treedive())

[^1]: parallelization through the future backend please refer to the parallelization vignette for details.

[^2]: memoization means that the results of the functions calls are cached and not recomputed when recalled, to toggle it off see the fundiversity::fd_fric()Details section.

Metadata

Version

1.1.1

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows