Learn R Programming

rbiom (version 1.0.3)

subset: Subset samples using the BIOM object's metadata

Description

Subset samples using the BIOM object's metadata

Usage

# S3 method for BIOM
subset(x, ...)

Value

A BIOM object.

Arguments

x

A BIOM object, as returned from read.biom.

...

Test to run on the metadata to identify samples to retain.

See Also

select

Examples

Run this code
    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