These functions are wrappers around dplyr::select() that provide convenient ways to modify tax_table(x) and sample_data(x). See dplyr::select() for supported syntax and helpers.

select_tax_table(x, ...)

# S4 method for taxonomyTable
select_tax_table(x, ...)

# S4 method for phyloseq
select_tax_table(x, ...)

select_sample_data(x, ...)

# S4 method for sample_data
select_sample_data(x, ...)

# S4 method for phyloseq
select_sample_data(x, ...)

Arguments

x

A phyloseq, taxonomyTable, or sample_data object

...

Expressions passed to dplyr::select()

Details

The special column names '.otu' and '.sample' should not be used; see mutate-phyloseq for the ability to change taxa and sample names using these names.

Examples

data(GlobalPatterns) GlobalPatterns %>% rank_names
#> [1] "Kingdom" "Phylum" "Class" "Order" "Family" "Genus" "Species"
GlobalPatterns %>% sample_variables
#> [1] "X.SampleID" "Primer" #> [3] "Final_Barcode" "Barcode_truncated_plus_T" #> [5] "Barcode_full_length" "SampleType" #> [7] "Description"
ps <- GlobalPatterns %>% select_tax_table(Phylum, Genus:Species) %>% select_sample_data(!dplyr::contains("Barcode"))
#> Error in select_sample_data(., !dplyr::contains("Barcode")): could not find function "select_sample_data"
ps %>% rank_names
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'colnames': error in evaluating the argument 'object' in selecting a method for function 'tax_table': object 'ps' not found
ps %>% sample_variables
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'colnames': error in evaluating the argument 'object' in selecting a method for function 'sample_data': object 'ps' not found