modify_metadata {rbiom} | R Documentation |
Create, modify, and delete metadata fields.
Description
mutate() creates new fields in $metadata
that are functions of existing
metadata fields. It can also modify (if the name is the same as an existing
field) and delete fields (by setting their value to NULL).
Usage
## S3 method for class 'rbiom'
mutate(.data, ..., clone = TRUE)
## S3 method for class 'rbiom'
rename(.data, ..., clone = TRUE)
Arguments
.data |
An rbiom object, such as from |
... |
Passed on to |
clone |
Create a copy of |
Value
An rbiom object.
See Also
Other transformations:
rarefy()
,
rarefy_cols()
,
slice_metadata
,
subset()
,
with()
Examples
library(rbiom)
biom <- slice_max(hmp50, BMI, n = 6)
biom$metadata
# Add a new field to the metadata
biom <- mutate(biom, Obsese = BMI >= 30)
biom$metadata
# Rename a metadata field
biom <- rename(biom, 'Age (years)' = "Age")
biom$metadata
[Package rbiom version 2.2.1 Index]