Description Usage Arguments Value Examples
This is the function called internally by beta.div, but is made
visible here so you can use it with matrices and trees without having to
first convert them to BIOM
objects.
1 |
biom |
A |
weighted |
Use weighted UniFrac, which takes abundance into account rather than simply presence/absence. |
tree |
A |
A distance matrix of class dist
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | library(rbiom)
infile <- system.file("extdata", "hmp50.bz2", package = "rbiom")
biom <- read.biom(infile)
biom <- select(biom, 1:10)
dm <- unifrac(biom)
plot(hclust(dm), cex=.8)
as.matrix(dm)[1:4,1:4]
# Using a custom matrix and tree
mtx <- matrix(sample.int(12*20), ncol=20)
dimnames(mtx) <- list(LETTERS[1:12], letters[1:20])
tree <- ape::as.phylo(hclust(dist(mtx)))
dm <- unifrac(mtx, tree=tree)
as.matrix(dm)[1:4,1:4]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.