Subset samples using the BIOM object's metadata
# S3 method for BIOM
subset(x, ...)
A BIOM
object.
A BIOM object, as returned from read.biom.
Test to run on the metadata to identify samples to retain.
select
library(rbiom)
infile <- system.file("extdata", "hmp50.bz2", package = "rbiom")
biom <- read.biom(infile)
ex1 <- subset(biom, Age > 30)
ex2 <- subset(biom, `Body Site` %in% c("Saliva", "Stool"))
ex3 <- subset(biom, Age < 25 & BMI > 22)
Run the code above in your browser using DataLab