Learn R Programming

rbiom (version 2.1.2)

with: Evaluate expressions on metadata.

Description

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

Usage

# S3 method for rbiom
with(data, expr, ...)

# S3 method for rbiom within(data, expr, clone = TRUE, ...)

Value

See description.

Arguments

data

An rbiom object, such as from as_rbiom().

expr

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

...

Not used.

clone

Create a copy of biom before modifying. If FALSE, biom is modified in place as a side-effect. See speed ups for use cases. Default: TRUE

See Also

Other transformations: modify_metadata, rarefy(), rarefy_cols(), slice_metadata, subset()

Examples

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

Run the code above in your browser using DataLab