View source: R/bind_pairwise.R
| bind_pairwise | R Documentation |
Combine two bioregion.pairwise objects and/or compute new pairwise
metrics based on the columns of the object(s).
bind_pairwise(primary_metrics, secondary_metrics, new_metrics = NULL)
primary_metrics |
A |
secondary_metrics |
A second |
new_metrics |
A |
When both primary_metrics and secondary_metrics are provided and if the
pairwise structure is identical the function combine the two objects. If
new_metrics is provided, each formula is evaluated based on the column
names of primary_metrics (and secondary_metrics if provided).
A new bioregion.pairwise object containing the combined and/or
enriched data. It includes all original metrics from the inputs, as well as
any newly computed metrics.
Maxime Lenormand (maxime.lenormand@inrae.fr)
Boris Leroy (leroy.boris@gmail.com)
Pierre Denelle (pierre.denelle@gmail.com)
For more details illustrated with a practical example, see the vignette: https://biorgeo.github.io/bioregion/articles/a3_pairwise_metrics.html.
Associated functions: dissimilarity similarity as_bioregion_pairwise
comat <- matrix(sample(0:1000, size = 50, replace = TRUE,
prob = 1 / 1:1001), 5, 10)
rownames(comat) <- paste0("s", 1:5)
colnames(comat) <- paste0("sp", 1:10)
sim <- bind_pairwise(primary_metrics = similarity(comat,
metric = "abc"),
secondary_metrics = similarity(comat,
metric = "Simpson"),
new_metrics = "1 - (b + c) / (a + b + c)")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.