similarity {bioregion}  R Documentation 
This function creates a data.frame
where each row provides one or
several similarity metric(s) between each pair of sites from a cooccurrence
matrix
with sites as rows and species as columns.
similarity(comat, metric = "Simpson", formula = NULL, method = "prodmat")
comat 
a cooccurrence 
metric 
a vector of string(s) indicating which similarity metric(s) to
chose (see Details). If 
formula 
a vector of string(s) with your own formula based on the

method 
a string indicating what method should be used to compute

With a
the number of species shared by a pair of sites, b
species only present in the first site and c
species only present in
the second site.
\(Jaccard = 1  (b + c) / (a + b + c)\)
\(Jaccardturn = 1  2min(b, c) / (a + 2min(b, c))\) (Baselga 2012)
\(Sorensen = 1  (b + c) / (2a + b + c)\)
\(Simpson = 1  min(b, c) / (a + min(b, c))\)
If abundances data are available, BrayCurtis and its turnover component can also be computed with the following equation:
\(Bray = 1  (B + C) / (2A + B + C)\)
\(Brayturn = 1  min(B, C)/(A + min(B, C))\) (Baselga 2013)
with A the sum of the lesser values for common species shared by a pair of sites. B and C are the total number of specimens counted at both sites minus A.
formula
can be used to compute customized metrics with the terms
a
, b
, c
, A
, B
, and C
. For example
formula = c("1  (b + c) / (a + b + c)", "1  (B + C) / (2*A + B + C)")
will compute the Jaccard and BrayCurtis similarity metrics, respectively.
Euclidean computes the Euclidean similarity between each pair of site following this equation:
\(Euclidean = 1 / (1 + d_{ij})\)
Where \(d_{ij}\) is the Euclidean distance between site i and site j in terms of species composition.
A data.frame
with additional class
bioregion.pairwise.metric
, providing one or several similarity
metric(s) between each pair of sites. The two first columns represent each
pair of sites.
One column per similarity metric provided in metric
and
formula
except for the metric abc and ABC that are
stored in three columns (one for each letter).
Maxime Lenormand (maxime.lenormand@inrae.fr), Pierre Denelle (pierre.denelle@gmail.com) and Boris Leroy (leroy.boris@gmail.com)
Baselga A (2012). “The Relationship between Species Replacement, Dissimilarity Derived from Nestedness, and Nestedness.” Global Ecology and Biogeography, 21(12), 1223–1232.
Baselga A (2013). “Separating the two components of abundancebased dissimilarity: balanced changes in abundance vs. abundance gradients.” Methods in Ecology and Evolution, 4(6), 552–557.
dissimilarity dissimilarity_to_similarity similarity_to_dissimilarity
comat < matrix(sample(0:1000, size = 50, replace = TRUE,
prob = 1 / 1:1001), 5, 10)
rownames(comat) < paste0("Site", 1:5)
colnames(comat) < paste0("Species", 1:10)
simil < similarity(comat, metric = c("abc", "ABC", "Simpson", "Brayturn"))
simil < similarity(comat, metric = "all",
formula = "1  (b + c) / (a + b + c)")