| hillpair | R Documentation |
Compute dissimilarity metrics for every pair of samples, returning distance objects suitable for ordination (e.g. NMDS, PCoA).
hillpair(
data,
q = c(0, 1, 2),
metric = c("S", "C", "U", "V"),
tree = NULL,
dist = NULL,
tau = NULL,
type = c("auto", "neutral", "phylogenetic", "functional"),
out = c("dist", "tibble"),
parallel = FALSE
)
data |
A count table (taxa x samples) or a supported object; a single sample is not meaningful for partitioning. |
q |
Numeric vector of diversity orders (>= 0). Defaults to
|
metric |
Dissimilarity metric(s) to return, any of |
tree |
A phylogenetic tree of class |
dist |
A functional distance matrix (or |
tau |
Optional functional distance threshold. Defaults to |
type |
Diversity type: |
out |
Output type: |
parallel |
Logical; if |
The type-specific structure (per-sample normalisation, the tree traversal or
the functional similarity product) is computed once over all samples via
the partitioning engine; each pair then only combines its two precomputed
columns into beta, which is turned into the requested overlap metrics. The
maths are therefore identical to hilldiss() on two samples, without
re-running the full engine per pair. When parallel = TRUE and the furrr
package is installed, pairs are computed in parallel via the active future
plan. A progressr progress bar is reported when that package is installed
and a handler is active.
For out = "dist", a named list of dist objects (one per
order/metric, named e.g. "q0S"), collapsed to a single dist when only
one combination is requested. For out = "tibble", a long-format
data.frame with columns first, second, q, metric, value.
hilldiss(), hilldiv()
counts <- matrix(c(10, 0, 5, 2, 8, 1, 3, 4, 0, 6, 2, 7), nrow = 3,
dimnames = list(c("t1", "t2", "t3"),
c("s1", "s2", "s3", "s4")))
hillpair(counts, q = 1, metric = "C")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.