| match_data | R Documentation |
Subsets and reorders a count table so that its taxa match those of a
phylogenetic tree or a functional distance matrix, dropping taxa absent from
the reference. This realises the match_data() helper that hilldiv2's
documentation referred to but never provided.
match_data(data, tree = NULL, dist = NULL)
data |
A count matrix/data.frame (taxa x samples) with row names. |
tree |
A |
dist |
A distance matrix (optional). |
The count matrix restricted to and ordered by the shared taxa.
counts <- matrix(1:6, nrow = 3,
dimnames = list(c("t1", "t2", "t3"), c("s1", "s2")))
tree <- ape::read.tree(text = "((t1:1,t2:1):1,t4:2);")
match_data(counts, tree = tree)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.