renameSampleVariables: Rename Sample Variables in Phyloseq Sample Data

View source: R/renameSampleVariables.R

renameSampleVariablesR Documentation

Rename Sample Variables in Phyloseq Sample Data

Description

Rename Sample Variables in Phyloseq Sample Data

Usage

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.

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.

Value

Phyloseq with modified sample_data

Author(s)

Sudarshan A. Shetty

References

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

Examples

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

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


RIVM-IIV-Microbiome/biomeUtils documentation built on July 20, 2023, 10:29 a.m.