Intersection between convex hulls of pairs of sitesSource:
Compute volume of the intersection of the convex hulls of all pairs of sites (including self-intersection, which corresponds to their convex hull). Note that when standardizing convex hulls of intersections, this function uses the convex hull of all provided traits, thus standardized volume of self-intersection hulls can be lower than one.
The matrix dataset for which you want to compute the index
Site-species matrix with sites as rows and species as columns if not provided, the function considers all species with equal abundance in a single site. This can be either a
data.frame, or a
a boolean indicating whether to standardize FRic values over the observed maximum over all species (default:
FALSE). This scales FRic between 0 and 1. NB: The maximum FRic values only considers species that are present in both site-species and trait matrices. If you want to consider species that are absent in the site-species matrix, add corresponding columns of 0s.
a data.frame with three columns:
first_sitethe names of the first site used in the pair
second_sitethe names of the first site used in the pair,
FRic_intersectthe volume of the convex hulls intersection of each pair of site.
NB: FRic_intersect is equal to
NA when there are strictly less species in
one of the sites than the number of provided traits.
By default, when loading fundiversity, the functions to
compute convex hulls are
memoised through the
package if it is installed. To deactivate this behavior you can set the
FALSE by running the following line:
options(fundiversity.memoise = FALSE). If you use it interactively it will
only affect your current session. Add it to your script(s) or
file to avoid toggling it each time.
The computation of this function can be parallelized thanks to
future::plan(). To get more information on how to parallelize your
computation please refer to the parallelization vignette with:
vignette("parallel", package = "fundiversity")
data(traits_birds) fd_fric_intersect(traits_birds) #> first_site second_site FRic_intersect #> 1 s1 s1 230967.7