| hillpart | R Documentation |
Partition neutral, phylogenetic or functional Hill-number diversity into
alpha, gamma and beta components across a set of samples. With a hierarchy
formula it instead performs multi-scale (nested) partitioning, returning
one beta per hierarchical level.
hillpart(
data,
q = c(0, 1, 2),
tree = NULL,
dist = NULL,
tau = NULL,
hierarchy = NULL,
metadata = NULL,
type = c("auto", "neutral", "phylogenetic", "functional"),
out = c("tibble", "matrix")
)
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
|
tree |
A phylogenetic tree of class |
dist |
A functional distance matrix (or |
tau |
Optional functional distance threshold. Defaults to |
hierarchy |
Optional one-sided nesting formula, coarsest to finest, e.g.
|
metadata |
Optional per-sample |
type |
Diversity type: |
out |
Output shape: |
A long-format data.frame of class hill_partition (default) with a
plot() method, or a matrix with columns alpha, gamma, beta and
diversity orders in rows when out = "matrix". With hierarchy, a
hill_hierarchy long-format data.frame (with its own plot() method) or
the corresponding wide matrix.
hilldiv(), hilldiss(), hillsim()
counts <- matrix(c(10, 0, 5, 2, 8, 1), nrow = 3,
dimnames = list(c("t1", "t2", "t3"), c("s1", "s2")))
hillpart(counts)
plot(hillpart(counts))
# Multi-scale partitioning across a nested design.
set.seed(1)
tab <- matrix(rpois(12 * 8, 5), nrow = 12,
dimnames = list(paste0("t", 1:12), paste0("s", 1:8)))
md <- data.frame(region = rep(c("N", "S"), each = 4),
site = rep(c("a", "b", "c", "d"), each = 2),
row.names = paste0("s", 1:8))
hillpart(tab, hierarchy = ~ region / site, metadata = md)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.