Rename Sample Variables in Phyloseq Sample Data

renameSampleVariables(x, with = FALSE, ...)

Arguments

x

phyloseq object

with

Default is FALSE. Set this to TRUE when using a function. See rename_with

...

Option to pass on to rename or rename_with. If using later, set with=TRUE.

Value

Phyloseq with modified sample_data

Details

In some cases user may want to rename one or several sample variables. With phyloseq, this needs to be done one by one. To ease this step, we make use of the rename and rename_with. The later allows to use functions such as those that work with string matching.

References

Shetty SA (2020). Utilities for microbiome analytics. https://github.com/RIVM-IIV-Microbiome/biomeUtils

Author

Sudarshan A. Shetty

Examples

library(biomeUtils)
library(dplyr)
data(FuentesIliGutData)
FuentesIliGutData <- renameSampleVariables(FuentesIliGutData,
                                           with=FALSE,
                                           condition = "ILI")

FuentesIliGutData <- renameSampleVariables(FuentesIliGutData,
                                           with=TRUE,
                                           .fn = toupper)