beta.div {rbiom} | R Documentation |
Make a distance matrix of samples vs samples.
Description
Make a distance matrix of samples vs samples.
Usage
beta.div(biom, method, weighted = TRUE, tree = NULL)
Arguments
biom |
A |
method |
The distance algorithm to use. Options are:
“manhattan”, “euclidean”,
“bray-curtis”, “jaccard”, and
“unifrac”. Non-ambiguous abbrevations of the method
names are also accepted. A phylogentic tree must be present in
|
weighted |
Take relative abundances into account. When
|
tree |
A |
Value
A distance matrix.
Examples
library(rbiom)
infile <- system.file("extdata", "hmp50.bz2", package = "rbiom")
biom <- read.biom(infile)
biom <- select(biom, 1:10)
dm <- beta.div(biom, 'unifrac')
as.matrix(dm)[1:4,1:4]
plot(hclust(dm))