{"id":13724501,"url":"https://github.com/funecology/fundiversity","last_synced_at":"2025-09-26T02:31:29.476Z","repository":{"id":38108332,"uuid":"300231216","full_name":"funecology/fundiversity","owner":"funecology","description":"📦 R package to compute functional diversity indices efficiently","archived":false,"fork":false,"pushed_at":"2025-07-18T11:32:00.000Z","size":12702,"stargazers_count":39,"open_issues_count":10,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-11T17:50:40.095Z","etag":null,"topics":["biodiversity","biodiversity-indicators","biodiversity-informatics","functional-diversity","functional-ecology","functional-trait","functional-traits","r","r-package","trait","trait-based","traits"],"latest_commit_sha":null,"homepage":"https://funecology.github.io/fundiversity/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/funecology.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":".zenodo.json"}},"created_at":"2020-10-01T10:00:24.000Z","updated_at":"2025-08-30T13:28:14.000Z","dependencies_parsed_at":"2024-03-25T10:59:00.899Z","dependency_job_id":"72aa8b51-1ea2-48a2-b3de-e84e44ae59dc","html_url":"https://github.com/funecology/fundiversity","commit_stats":{"total_commits":328,"total_committers":5,"mean_commits":65.6,"dds":0.4664634146341463,"last_synced_commit":"67981328c9ac15ee6228320b78f762247ec1edc8"},"previous_names":["bisaloo/fundiversity"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/funecology/fundiversity","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funecology%2Ffundiversity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funecology%2Ffundiversity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funecology%2Ffundiversity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funecology%2Ffundiversity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/funecology","download_url":"https://codeload.github.com/funecology/fundiversity/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funecology%2Ffundiversity/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275306299,"owners_count":25441451,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-15T02:00:09.272Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["biodiversity","biodiversity-indicators","biodiversity-informatics","functional-diversity","functional-ecology","functional-trait","functional-traits","r","r-package","trait","trait-based","traits"],"created_at":"2024-08-03T01:01:58.307Z","updated_at":"2025-09-26T02:31:29.437Z","avatar_url":"https://github.com/funecology.png","language":"R","funding_links":[],"categories":["Biosphere"],"sub_categories":["Biodiversity Analysis and Metrics"],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n\ntemp_dir = tempdir(check = TRUE)\n\npkg_has_vignettes_and_test = function(pkg_name, pkg_dir = temp_dir) {\n  pkg_archive = download.packages(pkg_name, destdir = pkg_dir,\n                                  repos = \"https://cran.r-project.org\")\n  \n  files_list = untar(pkg_archive[1, 2], list = TRUE)\n  \n  has_vignette = paste0(pkg_archive[1, 1], \"/vignettes/\") %in% files_list\n\n  has_tests = paste0(pkg_archive[1, 1], \"/tests/\") %in% files_list\n\n  c(ifelse(has_vignette, \"✅\", \"❌\"), ifelse(has_tests, \"✅\", \"❌\"))\n}\n```\n\n# fundiversity \u003cimg src=\"man/figures/logo.png\" align=\"right\" alt=\"fundiversity logo\" width=\"120\" /\u003e\n\n\u003c!-- badges: start --\u003e\n[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)\n[![R build status](https://github.com/funecology/fundiversity/workflows/R-CMD-check/badge.svg)](https://github.com/funecology/fundiversity/actions)\n[![Coverage Status](https://codecov.io/gh/funecology/fundiversity/branch/main/graph/badge.svg?token=HR4YH118VT)](https://app.codecov.io/gh/funecology/fundiversity)\n[![CRAN status](https://www.r-pkg.org/badges/version-ago/fundiversity)](https://CRAN.R-project.org/package=fundiversity)\n[![DOI](https://zenodo.org/badge/300231216.svg)](https://zenodo.org/badge/latestdoi/300231216)\n\u003c!-- badges: end --\u003e\n\n`fundiversity` provides a lightweight package to compute common functional\ndiversity indices. To a get a glimpse of what `fundiversity` can do refer to the\n[introductory vignette](https://funecology.github.io/fundiversity/articles/fundiversity.html).\nThe package is built using clear, public \n[design principles](https://funecology.github.io/fundiversity/articles/fundiversity_4-design-principles.html)\ninspired from our own experience and user feedback.\n\n\n## Installation\n\nYou can install the stable version from CRAN with:\n\n```{r, eval = FALSE}\ninstall.packages(\"fundiversity\")\n```\n\nAlternatively, you can install the development version with:\n\n```{r eval = FALSE}\ninstall.packages(\"fundiversity\", repos = \"https://bisaloo.r-universe.dev\")\n```\n\n\n## Examples\n\n`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\n`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](https://funecology.github.io/fundiversity/articles/fundiversity.html).\n\nAll indices can be computed either using global trait data or at the site-level:\n\n```{r example}\nlibrary(\"fundiversity\")\n\n# If only the trait dataset is specified, considers all species together\n# by default\nfd_fric(traits_birds)\n\n# We can also compute diversity across sites\nfd_fric(traits_birds, site_sp_birds)\n```\n\nTo compute Rao's Quadratic Entropy, the user can also provide a distance matrix between species directly:\n\n```{r rao-distance-matrix}\ndist_traits_birds = as.matrix(dist(traits_birds))\n\nfd_raoq(traits = NULL, dist_matrix = dist_traits_birds)\n```\n\n## Function Summary\n\n```{r child=\"man/rmdchunks/_fundiversity_functions.Rmd\"}\n```\n\n## Parallelization\n\nThanks 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](https://cran.r-project.org/package=future):\n\n```{r future-syntax, render=FALSE}\nfuture::plan(future::multisession)\nfd_fdiv(traits_birds)\n```\n\nFor more details please refer to the [parallelization vignette](https://funecology.github.io/fundiversity/articles/fundiversity_1-parallel.html) or use `vignette(\"fundiversity_1-parallel\", package = \"fundiversity\")` within R. **Note**: parallelization and memoization are **mutually exclusive**, when doing computation in parallel, fundiversity falls back on **unmemoised** versions of function.\n\n\n## Available functional diversity indices\n\nAccording to Pavoine \u0026 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](https://funecology.github.io/fundiversity/articles/fundiversity_3-correctness.html).\n`fundiversity` provides function to compute indices that assess this three facets at the site scale:\n\n|               Scale                |                                      Richness                                                                                                                              |                   Divergence                                                                                                                                                                                                                                                       |        Evenness                                                                        |\n|------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------|\n| α-diversity\u003cbr /\u003e(= among sites)   | FRic with [`fd_fric()`](https://funecology.github.io/fundiversity/reference/fd_fric.html)                                                                                     | FDiv with [`fd_fdiv()`](https://funecology.github.io/fundiversity/reference/fd_fdiv.html)\u003cbr /\u003eRao's QE with [`fd_raoq()`](https://funecology.github.io/fundiversity/reference/fd_raoq.html)\u003cbr /\u003eFDis with [`fd_fdis()`](https://funecology.github.io/fundiversity/reference/fd_fdis.html) | FEve with [`fd_feve()`](https://funecology.github.io/fundiversity/reference/fd_feve.html) |\n| β-diversity\u003cbr /\u003e(= between sites) | FRic pairwise intersection with [`fd_fric_intersect()`](https://funecology.github.io/fundiversity/reference/fd_fric_intersect.html)\u003cbr /\u003ealternatives available in `betapart` | available in `entropart`, `betapart` or `hillR`                                                                                                                                                                                                                                    | available in `BAT`    |\n \n## Related Packages\n\n```{r pkg-vign-tests, include = FALSE}\nadiv        = pkg_has_vignettes_and_test(\"adiv\")\nbat         = pkg_has_vignettes_and_test(\"BAT\")\nbetapart    = pkg_has_vignettes_and_test(\"betapart\")\nentropart   = pkg_has_vignettes_and_test(\"entropart\")\nfd          = pkg_has_vignettes_and_test(\"FD\")\nhilldiv     = pkg_has_vignettes_and_test(\"hilldiv\")\nhillr       = pkg_has_vignettes_and_test(\"hillR\")\nhypervolume = pkg_has_vignettes_and_test(\"hypervolume\")\ntpd         = pkg_has_vignettes_and_test(\"TPD\")\nvegan       = pkg_has_vignettes_and_test(\"vegan\")\n```\n\nSeveral other packages exist that compute functional diversity indices. We did a [performance comparison](https://funecology.github.io/fundiversity/articles/fundiversity_2-performance.html) between related packages. We here mention some of them (but do not mention the numerous wrappers around these packages): \n\n| Package Name                                          |                     Indices included                                                                                |    Has vignettes   |      Has tests     | On GitHub | On CRAN (last updated)                                    |\n|-------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------|--------------------|--------------------|-----------|-----------------------------------------------------------|\n| [`adiv`](https://github.com/cran/adiv)                | Functional Entropy, Functional Redundancy                                                                           |`r adiv[[1]]`       |`r adiv[[2]]`       | ❌       | ![](https://www.r-pkg.org/badges/last-release/adiv)       |\n| [`BAT`](https://github.com/cardosopmb/BAT)            | β-diversity indices, Richness, divergence, and evenness with hypervolumes                                           |`r bat[[1]]`        |`r bat[[2]]`        | ✅        | ![](https://www.r-pkg.org/badges/last-release/BAT)        |  \n| [`betapart`](https://github.com/cran/betapart)        | Functional β-diversity                                                                                              |`r betapart[[1]]`   |`r betapart[[2]]`   | ❌       | ![](https://www.r-pkg.org/badges/last-release/betapart)   |\n| [`entropart`](https://github.com/EricMarcon/entropart)| Functional Entropy                                                                                                  |`r entropart[[1]]`  |`r entropart[[2]]`  | ✅        | ![](https://www.r-pkg.org/badges/last-release/entropart)  |  \n| [`FD`](https://github.com/cran/FD)                    | FRic, FDiv, FDis, FEve, Rao's QE, Functional Group Richness                                                         |`r fd[[1]]`         |`r fd[[2]]`         | ❌       | ![](https://www.r-pkg.org/badges/last-release/FD)         |\n| [`hilldiv`](https://github.com/anttonalberdi/hilldiv) | Dendrogram-based Hill numbers for functional diversity                                                              |`r hilldiv[[1]]`    |`r hilldiv[[2]]`    | ✅       | ![](https://www.r-pkg.org/badges/last-release/hilldiv)    | \n| [`hillR`](https://github.com/daijiang/hillR)          | Functional Diversity Hill Numbers                                                                                   |`r hillr[[1]]`      |`r hillr[[2]]`      | ✅        | ![](https://www.r-pkg.org/badges/last-release/hillR)      |    \n| [`hypervolume`](https://github.com/cran/hypervolume)  | Hypervolume measure of functional diversity (~FRic)                                                                 |`r hypervolume[[1]]`|`r hypervolume[[2]]`| ✅        | ![](https://www.r-pkg.org/badges/last-release/hypervolume)|\n| [`mFD`](https://github.com/CmlMagneville/mFD)         | Functional α- and β-diversity indices, including FRic, FDiv, FDis, FEve, FIde, FMPD, FNND, FOri, FSpe, Hill Numbers | ✅                 | ❌                | ✅          | ![](https://www.r-pkg.org/badges/last-release/mFD)     |\n| [`TPD`](https://github.com/cran/TPD)                  | FRic, FDiv, FEve but for probability distributions                                                                  |`r tpd[[1]]`        |`r tpd[[2]]`        | ❌       | ![](https://www.r-pkg.org/badges/last-release/TPD)        |\n| [`vegan`](https://github.com/vegandevs/vegan)         | Only dendrogram-based FD (`treedive()`)                                                                             |`r vegan[[1]]`      |`r vegan[[2]]`      | ✅        | ![](https://www.r-pkg.org/badges/last-release/vegan)      |                 \n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunecology%2Ffundiversity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffunecology%2Ffundiversity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunecology%2Ffundiversity/lists"}