library(rbiom)
infile <- system.file("extdata", "hmp50.bz2", package = "rbiom")
biom <- read.biom(infile)
colnames(biom$taxonomy)
phyla <- taxa.rollup(biom, 'Phylum')
phyla[1:4,1:6]
# Custom matrices should be formatted like so:
counts <- as.matrix(biom$counts)
map <- biom$taxonomy
counts[1:3,1:6]
map[1:3,1:4]
phyla <- taxa.rollup(counts, 'Phylum', map=map)
phyla[1:3,1:6]
Run the code above in your browser using DataLab