rename-phyloseq: Rename columns in the taxonomy table or sample data

rename-phyloseqR Documentation

Rename columns in the taxonomy table or sample data

Description

rename_tax_table() and rename_with_tax_table() provide the functionality of dplyr::rename() and dplyr::rename_with() to phyloseq taxonomy tables; rename_sample_data() and rename_with_sample_data() provide this functionality to phyloseq sample data.

Usage

rename_tax_table(x, ...)

## S4 method for signature 'taxonomyTable'
rename_tax_table(x, ...)

## S4 method for signature 'phyloseq'
rename_tax_table(x, ...)

rename_with_tax_table(x, ...)

## S4 method for signature 'taxonomyTable'
rename_with_tax_table(x, ...)

## S4 method for signature 'phyloseq'
rename_with_tax_table(x, ...)

rename_sample_data(x, ...)

## S4 method for signature 'sample_data'
rename_sample_data(x, ...)

## S4 method for signature 'phyloseq'
rename_sample_data(x, ...)

rename_with_sample_data(x, ...)

## S4 method for signature 'sample_data'
rename_with_sample_data(x, ...)

## S4 method for signature 'phyloseq'
rename_with_sample_data(x, ...)

Arguments

x

A phyloseq, taxonomyTable, or sample_data object

...

Renaming expressions passed to dplyr::rename() or arguments passed to dplyr::rename_with()

Examples

data(GlobalPatterns)

GlobalPatterns %>% rank_names

ps1 <- GlobalPatterns %>%
  rename_tax_table(Domain = Kingdom) %>%
  rename_with_tax_table(stringr::str_to_lower)
ps1 %>% rank_names

GlobalPatterns %>% sample_variables
ps2 <- GlobalPatterns %>%
  rename_with_sample_data(janitor::make_clean_names) %>%
  rename_sample_data(sample_id = x_sample_id)
ps2 %>% sample_variables

mikemc/speedyseq documentation built on April 22, 2024, 6:40 p.m.