mikemc / phyloseqpp

Phyloseq extensions and functions for tidier analysis of microbiome data
Other
2 stars 0 forks source link

Add taxa_are_rows arg to `otu_table(physeq)` #10

Open mikemc opened 5 years ago

mikemc commented 5 years ago

So that one could ask for the otu_table in a certain format regardless of the format it is stored as in physeq, without needing to check. So the fairly verbose

if (taxa_are_rows(ps) {
  otu <- otu_table(ps) %>% t
} else {
  otu <- otu_table(ps)
}
pcx <- prcomp(otu)

could become simply

pcx <- otu_table(ps, taxa_are_rows = FALSE) %>% prcomp