Functional Rarity Indices Computation

Computes functional rarity indices as proposed by Violle et al. (2017) . Various indices can be computed using both regional and local information. Functional Rarity combines both the functional aspect of rarity as well as the extent aspect of rarity. 'funrar' is presented in Grenié et al. (2017) .

Travis-CI Build Status DOI

funrar is a package to compute functional rarity indices, it quantifies how species are rare both from a functional and an extent point of view. Following the different facets of rarity proposed by Rabinowitz (1981). See this reference for more details on Functional Rarity indices:


NEWS: the funrar paper just got published

Please cite the following reference when using funrar in a paper:

Grenié M, Denelle P, Tucker CM, Munoz F, Violle C. funrar: An R package to characterize functional rarity. Divers Distrib. 2017;00:1–7.

or refer to the CITATION file, using:

citation(package = "funrar")


The package is on CRAN, you can install it using:


If you want to have the latest development version use devtools:

# install.packages("devtools") # If 'devtools' is not installed yet
devtools::install_github("Rekyt/funrar", build_vignettes = TRUE)


Apart from base packages dependencies, funrar depends on dplyr and cluster.

Example vignettes

In addition to code example included in help of functions, two vignettes explain how to use the package. The functional rarity indices vignette explains in details the different indices and function provided; while the sparse matrices vignette shows how to use sparse matrices to gain speed in memory when computing functional rarity indices.

Access the vignette through R using the vignette() function.


Rabinowitz D., Seven forms of rarity In The Biological Aspects of Rare Plant Conservation (1981), pp. 205-217


funrar 1.2.2

  • Fix a bug in the test of distinctiveness_dimensions() that generated errors on cran server.

funrar 1.2.1

  • Add Authors' ORCID and all contributors;
  • funrar paper is now included in DESCRIPTION, and has a proper CITATIONq file;
  • Fix typos in documentation;
  • Transformation from tidy data.frame to sparse matrix is now possible using stack_to_matrix(x, sparse = TRUE) (#25);
  • Add a warning message when using only continuous traits with function comput_dist_matrix(), as it defaults to Gower's distance (#27);
  • Specification in help that functional distances need to be scaled between 0 and 1 prior to distinctiveness computation (#26).

funrar 1.2.0

  • Split rarity_dimensions() in two more explicit functions: uniqueness_dimensions() and distinctiveness_dimensions() split corresponding tests;
  • Add internal function to compute multiple functional distance matrix using a single trait table (combination_trait_dist());
  • distinctiveness() now fully conserve the dimnames of the provided site-species matrix.

funrar 1.1.1

  • Add tests for rarity_dimensions();
  • rarity_dimensions() now comprises both Uniqueness and Distinctiveness;
  • Remove packages StatMatch, microbenchmark & reshape2 from suggested packages.

funrar 1.1.0

  • Made make_absolute() defunct because it was based on false assumptions and would not give back matrices of relative abundances;
  • Improved examples of make_relative(), uniqueness(), distinctiveness() to compute across single communities or regional pools;
  • Add rarity_dimensions() function to measure the different facets of rarity according to the trait;
  • Add center and scale arguments in compute_dist_matrix() to scale traits before computing distance, these arguments are sensitive to the specific distance metric used;
  • Use markdown with roxygen2 to generates documentation.

funrar 1.0.3

  • Corrected bug so that dense matrices can be transformed to stack data frame using matrix_to_stack() (#19),
  • Updated citation for Violle et al. 2017,
  • Use package goodpractice to enforce better code style,
  • Add is_relative() function to test if matrix contains relative abundances, scarcity() and distinctiveness() now warns if it is not the case (#21),
  • Conditionnally use microbenchmark following CRAN advices.

funrar 1.0.2

  • Added functions to convert absolute abundance matrix to relative abundance matrix, make_relative() and reverse function make_absolute(),
  • Added a file to track changes to the package.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


1.4.1 by Matthias Grenié, 2 years ago

Report a bug at

Browse source code at

Authors: Matthias Grenié [aut, cre] , Pierre Denelle [aut] , Caroline Tucker [aut] , François Munoz [ths] , Cyrille Violle [ths]

Documentation:   PDF Manual  

GPL (>= 2) license

Imports cluster, methods, stats

Suggests ade4, ggplot2, knitr, Matrix, rmarkdown, testthat, tidytext

See at CRAN