with: Evaluate expressions on metadata.

withR Documentation

Evaluate expressions on metadata.

Description

with() will return the result of your expression. within() will return an rbiom object.

Usage

## S3 method for class 'rbiom'
with(biom, ...)

## S3 method for class 'rbiom'
within(biom, ..., clone = TRUE)

Arguments

biom

An rbiom object, such as from as_rbiom().

...

Passed on to base::with() or base::within().

Value

See description.

See Also

Other transformations: mutate(), rarefy(), rarefy_cols(), slice(), subset()

Examples

    library(rbiom) 
    
    with(hmp50, table(`Body Site`, Sex))
    
    biom <- within(hmp50, {
      age_bin = cut(Age, 5)
      bmi_bin = cut(BMI, 5)
    })
    biom$metadata


cmmr/rbiom documentation built on May 18, 2024, 6:34 a.m.