powered by
with() will return the result of your expression. within() will return an rbiom object.
with()
within()
# S3 method for rbiom with(data, expr, ...)# S3 method for rbiom within(data, expr, clone = TRUE, ...)
# S3 method for rbiom within(data, expr, clone = TRUE, ...)
See description.
An rbiom object, such as from as_rbiom().
as_rbiom()
Passed on to base::with() or base::within().
base::with()
base::within()
Not used.
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
biom
FALSE
TRUE
Other transformations: modify_metadata, rarefy(), rarefy_cols(), slice_metadata, subset()
modify_metadata
rarefy()
rarefy_cols()
slice_metadata
subset()
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