Volume 23, Issue 12
BIODIVERSITY LETTER
Open Access

funrar: An R package to characterize functional rarity

Matthias Grenié

Corresponding Author

E-mail address: matthias.grenie@cefe.cnrs.fr

Centre d’Écologie Fonctionnelle et Évolutive (UMR 5175), CNRS – Université de Montpellier – Université Paul Valéry Montpellier, EPHE, Montpellier, France

Correspondence

Matthias Grenié, Centre d’Écologie Fonctionnelle et Évolutive (UMR 5175), CNRS – Université de Montpellier – Université Paul Valéry Montpellier, EPHE, Montpellier, France.

Email: matthias.grenie@cefe.cnrs.fr

Search for more papers by this author
Pierre Denelle

Centre d’Écologie Fonctionnelle et Évolutive (UMR 5175), CNRS – Université de Montpellier – Université Paul Valéry Montpellier, EPHE, Montpellier, France

Search for more papers by this author
Caroline M. Tucker

Centre d’Écologie Fonctionnelle et Évolutive (UMR 5175), CNRS – Université de Montpellier – Université Paul Valéry Montpellier, EPHE, Montpellier, France

Department of Biology, University of North Carolina at Chapel Hill. Coker Hall, CB #3280 120 South Road, Chapel Hill, NC, 27599‐3280 USA

Search for more papers by this author
François Munoz

University of Montpellier, AMAP, Montpellier, France

French Institute of Pondicherry, Pondicherry, India

Search for more papers by this author
Cyrille Violle

Centre d’Écologie Fonctionnelle et Évolutive (UMR 5175), CNRS – Université de Montpellier – Université Paul Valéry Montpellier, EPHE, Montpellier, France

Search for more papers by this author
First published: 11 September 2017
Citations: 17

Abstract

Emphasis has been put in recent ecological research on investigating phylogenetic, functional and taxonomic facets of biological diversity. While a flourishing number of indices have been proposed for assessing functional diversity, surprisingly few options are available to characterize functional rarity. Functional rarity can play a key role in community and ecosystem dynamics. We introduce here the funrar R package to quantify functional rarity based on species trait differences and species frequencies at local and regional scales. Because of the increasing availability of big datasets in macroecology and biogeography, we optimized funrar to work with large datasets of thousands of species and sites. We illustrate the use of the package to investigate the functional rarity of North and Central American mammals.

1 A TOOLKIT FOR THE DEFINITION AND QUANTIFICATION OF FUNCTIONAL RARITY

Biodiversity is multifaceted (Cardoso, Rigal, Borges, & Carvalho, 2014; Safi et al., 2011), and many indices have been proposed to summarize the taxonomic, phylogenetic and functional composition of ecological assemblages (Jarzyna & Jetz, 2016; Mazel et al., 2014). Such indices are used to investigate the influence of ecological, biogeographical and evolutionary processes at local and regional scales (McGill, Enquist, Weiher, & Westoby, 2006; Violle, Reich, Pacala, Enquist, & Kattge, 2014; Weiher et al., 2011). Many indices, such as community‐weighted moments, emphasize the contribution of abundant taxa because they are expected to make significant contributions to community and ecosystem functioning (Grime, 1998; Enquist et al. 2015), while the role of rare taxa is less addressed.

Rarity relates to biodiversity dynamics at multiple scales of geographical and niche space. Rabinowitz (1981) defined rarity based on the geographical range, habitat specificity and local population size of taxa, yielding seven forms of rarity. More recently, Violle et al. (2017) extended the scope of Rabinowitz's (1981) classification to further incorporate differences in functional traits among taxa, defining a new component—functional rarity. In this perspective, a species (or an individual) can be rare because of the uncommonness of its trait values and/or because of its low abundance at the local scale (Pavoine, Ollier, & Dufour, 2005). Indices of Functional Distinctiveness and Taxon Scarcity were proposed to quantify those two aspects at the local scale, respectively. A species can also be functionally rare at the regional scale because its functional characteristics are unique given the pool of species and/or because it is spatially restricted. Functional Uniqueness and Taxon Restrictedness respectively assess these two aspects at the regional scale. The four indices together provide a framework for characterizing functional rarity (Figures 1 and 2). Because functional rarity is expected to play a major role in ecosystem and biodiversity dynamics, the indices can be used to assess the influences of rare trait values on local and regional dynamics (Ricotta et al., 2016; Violle et al., 2017). We here introduce an R (R Core Team, 2016) package named funrar, to quantify functional rarity based on abundance or occurrence data and trait data. The funrar package, available through the Comprehensive R Archive Network (CRAN), computes Functional Distinctiveness, Functional Uniqueness, Taxon Scarcity and Taxon Restrictedness and is optimized to handle high‐dimensional data (large number of sites and/or large number of species) using sparse matrix algebra. We illustrate the application of this package for examining functional rarity using data on North and Central American mammals (Lawing, Eronen, Blois, Graham, & Polly, 2017) (the code to run the analyses is available on Github at https://github.com/Rekyt/mamm_funrar archived on Zenodo https://doi.org/10.5281/zenodo.375605).

image
Basic patterns of Functional Rarity. Four species A to D are illustrated. Functional indices are represented in top figures: Functional Distinctiveness (left) is the average functional distance of a species to the other species in the community, species D is absent from this community, thus, the Distinctiveness of species C DC is simply the average of distance of species C to species A, dCA, and to species B, dCB; Functional Uniqueness (top right) is the functional distance of a species to its nearest neighbour in a regional species pool (see Equation 3); here, A and D are nearest neighbours as well as B and C. Taxon Scarcity (bottom left), where Si denotes the Scarcity of species i, it is inversely proportional to the abundance of species i (see Equation 4), because species D is absent from the community its scarcity cannot be computed; Taxon Restrictedness (bottom right) is assessed from the occurrences of species across four sites (four tiles) and Ri denotes the Restrictedness of species i, it equals one minus the number of times a species across all sites over the total number of sites (see Equation 5), species A is present in all four sites, thus its Restrictedness RA equals zero. [Colour figure can be viewed at wileyonlinelibrary.com]
image
Functions available in funrar to compute the different facets of functional rarity. Functions handle two formats of site composition, the default one assumes that the input dataset is a site‐species matrix, while the _stack() versions use “tidy” format; _com() functions provided for Functional Distinctiveness and Scarcity take a single community as input. Note that regional‐level indices—Restrictedness and Functional Uniqueness—are computed using the complete dataset, giving a single index per species. The site‐level indices—Functional Distinctiveness and Scarcity—are computed for each site‐species combination, giving one value per site‐species combination

2 QUANTIFYING FUNCTIONAL RARITY USING funrar FUNCTIONS

Users must provide a site‐by‐species matrix of community composition across sites, with either the presence–absence or relative abundances of species. funrar functions can handle site‐by‐species data in any of three formats: site‐species matrix (with sites as rows and species as columns, see Figure 1 for available functions); “tidy” format (Wickham, 2014), with each row coding the observation of a single species at a given site (the function has a _stack suffix); or as a single community (the function has a _com suffix). Abundance or occurrence information can be based on population or community census and possibly account for imperfect detection (Dénes, Silveira, & Beissinger, 2015; Iknayan, Tingley, Furnas, & Beissinger, 2014; Jarzyna & Jetz, 2016).

Functional distances or dissimilarities are used in the calculation of functional rarity indices (Violle et al., 2017). In funrar, a functional distance matrix can be calculated from a table of one or several traits measured for each taxa with compute_dist_matrix(). Different kinds of traits (continuous, categorical, ordinal) can be scaled or weighted in various ways when combined (Pavoine, Vallet, Dufour, Gachet, & Daniel, 2009). By default compute_dist_matrix() computes the unweighted Gower's (1971) distance because it covers classes of trait data and makes them comparable, but the user can also specify euclidean or manhattan distances. It is possible to scale traits using the center and scale arguments when traits are continuous.

Functional Distinctiveness and Functional Uniqueness are computed from the functional distance and species composition matrices. Functional Distinctiveness (Di, distinctiveness()) of a species, that is the uncommonness of a species’ traits compared to other species’ traits in an assemblage (Figure 1 bottom left), weighted or not by species’ relative abundances (Violle et al., 2017) is:
urn:x-wiley:13669516:media:ddi12629:ddi12629-math-0001(1)
with dij the functional dissimilarity between species i and species j, N the total number of species in the given assemblage, Aj the relative abundance of species j in the given assemblage. Di is scaled between zero, if the focal species is identical to all the other species, and one when the focal species is most dissimilar to the other species. If only the presences–absences are provided, Aj = 1/N for all j and Di simplifies as:
urn:x-wiley:13669516:media:ddi12629:ddi12629-math-0002(2)

Di is the mean dissimilarity of a focal species as defined in Ricotta et al. (2016), that is the mean pairwise functional dissimilarity from a focal species to all the others. Functional Distinctiveness then relates to functional redundancy in an assemblage: the larger the index value, the more distant (less redundant) a species (or an individual) is to the average functional position of the assemblage in the functional space, that is the centroid.

Functional Uniqueness (Ui, uniqueness()) is the functional distance of a focal species i to its nearest neighbour in a set of assemblages (Figure 1 bottom right):
urn:x-wiley:13669516:media:ddi12629:ddi12629-math-0003(3)
with dij the functional dissimilarity between species i and species j, for all pairs of species considered across the site‐species matrix with j ≠ i. It quantifies how isolated a species is in the functional space without considering abundances: the higher the index value, the more distant a species is to its closest neighbour in the functional space.

As emphasized by Violle et al. (2017), a species can be functionally distinct (high Di) in a given community but not functionally unique in an entire region (small Ui). In this regard, Distinctiveness and Uniqueness are used to uncover scale‐dependent biodiversity dynamics: by default, funrar provides the former at local site level while the latter is computed at regional scale (whole site‐species matrix). At local scale, community dynamics involve all coexisting species and their relative abundance is expected to convey the signature of assembly processes. Between‐species dissimilarities and Functional Distinctiveness are thus relevant to assess the role of functional originality in community assembly. At regional scale, Functional Uniqueness can represent how taxa depart from a regional pool due to specific biogeographical and evolutionary legacies and should then be estimated based on the whole site‐species matrix. Nevertheless, each index can be computed at both scales to grasp the different aspects of functional rarity (examples in the help of distinctiveness() and uniqueness()).

Because Distinctiveness and Uniqueness are computed using multiple traits, it can be difficult to disentangle if a species exhibits high values because of a single extreme trait value or because it has several rare trait values. The uniqueness_dimensions() and distinctiveness_dimensions() functions respectively compute Uniqueness and Distinctiveness values from the traits taken one by one as well as altogether. The former outputs a table with the value of Uniqueness for each trait and for all the traits considered together, while the latter outputs a list of site‐species matrices of computed Distinctiveness values, one matrix per trait and one for all the traits considered together.

The second set of functions deals with the taxon component of functional rarity. Two indices estimate it: Taxon Scarcity (scarcity()) in an assemblage and Taxon Restrictedness (restrictedness()) in a set of assemblages. Taxon Scarcity (scarcity()) of a species in a given assemblage gets close to one when the species has low abundance in the site and gets close to zero when it dominates the assemblage:
urn:x-wiley:13669516:media:ddi12629:ddi12629-math-0004(4)
where N is the number of species and Ai the relative abundance of species i at the focal site. When species are equally abundant in the assemblage, with 1/N relative abundances, Si equals 0.5. Scarcity cannot be computed with only the presence–absence data in the site‐by‐species matrix.
Taxon Restrictedness is an index between zero and one. It increases when a species is present in less sites of the site‐species matrix. Restrictedness nearly equals one when a species is present in a single site (examples on Figure 1):
urn:x-wiley:13669516:media:ddi12629:ddi12629-math-0005(5)
where Ki is the number of sites where species i occurs and Ktot the total number of sites in the dataset. Ri equals one when the species is completely absent from the dataset. Restrictedness can also be computed for predicted species distributions from ecological models (Guisan & Thuiller, 2005). A threshold of the predicted probabilities of occurrence (Jiménez‐Valverde & Lobo, 2007; Liu, Berry, Dawson, & Pearson, 2005) is then used to derive the matrix of species occurrences per pixel.

Because of the increasing availability of large‐scale and intensive datasets in ecology (Hampton et al., 2013), a site‐species matrix can contain thousands of sites and thousands of species. However, as not all species are everywhere, site‐species matrices are usually filled with many zeroes. Sparse matrices allow storing only the position of non‐zero cells, saving memory. funrar performs sparse matrix calculations using the Matrix package for quicker and memory‐efficient computations (Bates & Maechler, 2016). For more details, see the vignette included in the package.

3 FUNCTIONAL RARITY OF NORTH AND CENTRAL AMERICAN MAMMALS

We used funrar to analyse a subset of the dataset of North and Central American Mammals from Lawing et al. (2017), Lawing, Eronen, Blois, Graham, and Polly (2016). We selected 265 species out of 558 for which trait information was available. We used six traits relevant to mammal ecology (body mass, litter size, diet breadth, trophic level, habitat breadth and terrestriality, see Jones et al. (2009) for detailed trait explanation). The dataset comprises the presence–absence information for the 265 species across 9699 50 km x 50 km cells. We asked whether there are “hotspots” of Functional Uniqueness in North America and Central America for the six aforementioned traits; whether species that are functionally unique are geographically restricted; what the most functionally distinct and unique mammal species in the dataset are; and whether there are more functionally rare species in temperate, tropical or boreal areas.

For each species, we calculated Functional Uniqueness and Taxon Restrictedness indices and averaged them across species by grid cell. Because those two indices are regional‐level indices, each species had a unique value, and the variation in averaged indices among grid cells thus reflects change in species composition. We produced maps of the average values for indices in North and Central America (Figure 3). We also computed functional rarity—the average of Functional Uniqueness and Taxon Restrictedness—where each is scaled between zero and one. The most functionally unique cells were in Cuba (Figure 3a), meaning that they hosted, on average, species that are quite functionally unique compared to the species pool of North and Central America. This pattern may be due to the tropical climate present in Cuba, which is less present across the rest of the dataset. We also identified a latitudinal gradient in Taxon Restrictedness (Figure 3b): sites at low latitude hosted more restricted species on average than sites in temperate and boreal regions, a pattern that complies with Rapoport's rule (Gaston, Blackburn, & Spicer, 1998; Rapoport, 1982). Altogether, combining the two facets into a single index highlighted Cuba as a hotspot of functional rarity (Figure 3c).

image
Maps of functional rarity indices averaged per site in North and Central America using a subset of the dataset of North and Central American Mammals from Lawing et al. (2017). All indices have been scaled per site between 0 and 1. (a) Functional Uniqueness; (b) Taxon Restrictedness; (c) Functional Rarity, the average of Functional Uniqueness and Taxon Restrictedness per site. The geographical projection of maps is Albers Equal Area (ESRI:102008). [Colour figure can be viewed at wileyonlinelibrary.com]

At the species level, Functional Uniqueness and Taxon Restrictedness were not correlated (Spearman's rho = −.06, = .323) (Figure 4). Most species were geographically restricted (with many values around 1, meaning that they were present in a few grid cells only) but functionally redundant, that is with low values of Functional Uniqueness. Conversely, almost no species were both geographically widespread and functionally unique, apart from Castor canadensis (red dot in the bottom right corner of Figure 4), which occupies a very specific habitat (fossorial and ground dwelling) and is distributed continent‐wide. Functional Distinctiveness and Functional Uniqueness were correlated (Spearman's rho = .37, < .001), indicating that species that were locally functionally distinct tended to be regionally functionally unique. Even though local functional rarity and regional functional rarity were quite correlated, the weak correlation implies that rarity should be estimated both at the local and regional scale because it contrasts different types of rarity.

image
Biplot of Functional Uniqueness against Taxon Restrictedness per species across the whole dataset (= 265 species). Note that both Functional Uniqueness and Taxon Restrictedness have been scaled between zero and one for easier comparison (Spearman's rho = –.06, p = .323, S = 3290600). The red dot indicates the position of Castor canadensis. Marginal distributions are indicated on the sides of the graph. [Colour figure can be viewed at wileyonlinelibrary.com]

In summary, North and Central American mammals display a biogeographical gradient of functional rarity, such as species at low latitude show higher Functional Uniqueness and Taxon Restrictedness (Figure 3), even though most mammal species have low Functional Uniqueness and high Taxon Restrictedness (top left corner in Figure 4). The absence of correlation of Functional Uniqueness and Taxon Restrictedness shows that these components of functional rarity provide complementary information. Therefore, both components should be considered when mapping rarity and defining priority targets in conservation programs.

4 CONCLUSION

Conservation biology has historically focused on the protection of rare species in terms of taxon occurrences and abundances (Prendergast, Quinn, Lawton, Eversham, & Gibbons, 1993). Although it can be decomposed in local, regional and habitat dimensions (Rabinowitz, 1981), this approach has emphasized taxonomic rarity and neglected the originality of functional attributes. Recently though, assessing species originality in terms of phylogenetic rarity (Cadotte & Jonathan Davies, 2010; Isaac, Turvey, Collen, Waterman, & Baillie, 2007; Rosauer, Laffan, Crisp, Donnellan, & Cook, 2009) and functional rarity (Mouillot et al., 2013; Umaña, Zhang, Cao, Lin, & Swenson, 2015; Violle et al., 2017) has gained momentum. It underlines the need to characterize patterns of rarity through the ecological and evolutionary attributes that influence biodiversity dynamics at multiple scales. Uncorrelated Functional Uniqueness and Restrictedness in North and Central American Mammals suggest that the functional component of rarity should be considered for a more comprehensive assessment of biodiversity dynamics and a better design of conservation strategies. Such integrated view on rarity echoes Winter, Devictor, and Schweiger (2013) suggestion to “[include] other facets of diversity” for conservation. The funrar package contributes to the growing toolbox available for researchers to study and quantify the various dimensions of biodiversity and rarity. Adding the functional rarity string would strengthen the bow of diversity and rarity facets.

ACKNOWLEDGEMENTS

This research is supported by the French Foundation for Research on Biodiversity (FRB; www.fondationbiodiversite.fr) in the context of the CESAB project “Causes and consequences of functional rarity from local to global scales” (FREE). PD and CV were supported by the European Research Council (ERC) Starting Grant Project “Ecophysiological and biophysical constraints on domestication of crop plants” (Grant ERC‐StG‐2014‐639706‐CONSTRAINTS). CMT acknowledges the European Commission for the Marie Curie IIF (H2020‐MSCA‐IF‐2014‐657951).

    DATA ACCESSIBILITY

    funrar stable version is available on CRAN (via install.package(“funrar”) or https://cran.r-project.org/package=funrar) and the development version is on Github at https://github.com/Rekyt/funrar. The code necessary to reproduce the analyses is on Github at https://github.com/Rekyt/mamm_funrar, an archived version is accessible on Zenodo https://doi.org/10.5281/zenodo.375605

    BIOSKETCH

    Matthias Grenié is a PhD student at the University of Montpellier and at the Centre d’Écologie Fonctionnelle et Évolutive in Montpellier. He studies the common determinants of diversity across different taxonomic groups and has broad interests in biogeography, community ecology and functional ecology.

    Author contributions: M.G. and P.D. designed the package; C.T. reviewed it; M.G. wrote the first draft of the manuscript; and all the authors edited and commented it.

      Number of times cited according to CrossRef: 17

      • Ecological distinctiveness of birds and mammals at the global scale, Global Ecology and Conservation, 10.1016/j.gecco.2020.e00970, (e00970), (2020).
      • Extinctions of Threatened Frogs may Impact Ecosystems in a Global Hotspot of Anuran Diversity, Herpetologica, 10.1655/0018-0831-76.2.121, 76, 2, (121), (2020).
      • Tropical forest loss drives divergent patterns in functional diversity of forest and non‐forest birds, Biotropica, 10.1111/btp.12795, 52, 4, (738-748), (2020).
      • Global distribution and conservation status of ecologically rare mammal and bird species, Nature Communications, 10.1038/s41467-020-18779-w, 11, 1, (2020).
      • Integrating Computational Methods to Investigate the Macroecology of Microbiomes, Frontiers in Genetics, 10.3389/fgene.2019.01344, 10, (2020).
      • How modified landscapes filter rare species and modulate the regional pool of ecological traits?, Hydrobiologia, 10.1007/s10750-020-04405-9, (2020).
      • Species niches, not traits, determine abundance and occupancy patterns: A multi‐site synthesis, Global Ecology and Biogeography, 10.1111/geb.13029, 29, 2, (295-308), (2019).
      • Geographical Patterns of Functional Diversity of South American Anurans, Biogeographic Patterns of South American Anurans, 10.1007/978-3-030-26296-9, (107-123), (2019).
      • Effects of climate and land-use gradients on avian phylogenetic and functional diversity in a tropical dry forest, Journal of Arid Environments, 10.1016/j.jaridenv.2019.104024, (104024), (2019).
      • Evaluating functional diversity conservation for freshwater fishes resulting from terrestrial protected areas, Freshwater Biology, 10.1111/fwb.13395, 64, 11, (2057-2070), (2019).
      • Plant invasion alters trait composition and diversity across habitats, Ecology and Evolution, 10.1002/ece3.5130, 9, 11, (6199-6210), (2019).
      • Difficult decisions: Strategies for conservation prioritization when taxonomic, phylogenetic and functional diversity are not spatially congruent, Biological Conservation, 10.1016/j.biocon.2018.06.014, 225, (128-133), (2018).
      • Functional rarity of coral reef fishes at the global scale: Hotspots and challenges for conservation, Biological Conservation, 10.1016/j.biocon.2018.08.011, 226, (288-299), (2018).
      • Transcending data gaps: a framework to reduce inferential errors in ecological analyses, Ecology Letters, 10.1111/ele.13089, 21, 8, (1200-1210), (2018).
      • Functional diversity and redundancy of freshwater fish communities across biogeographic and environmental gradients, Diversity and Distributions, 10.1111/ddi.12812, 24, 11, (1612-1626), (2018).
      • Plant Functional Diversity and the Biogeography of Biomes in North and South America, Frontiers in Ecology and Evolution, 10.3389/fevo.2018.00219, 6, (2018).
      • A Common Toolbox to Understand, Monitor or Manage Rarity? A Response to Carmona et al., Trends in Ecology & Evolution, 10.1016/j.tree.2017.10.001, 32, 12, (891-893), (2017).

      The full text of this article hosted at iucr.org is unavailable due to technical difficulties.