Description Usage Arguments Value See Also Examples
physeq2veg_otu is a helper function intended to convert the species/taxa count slot of a phyloseq object to a vegan-friendly matrix. This function ensures that sites/samples are rows and species are columns.
1 | pstoveg_otu(PS)
|
PS |
(required) a phyloseq object |
A matrix containing a phyloseq object's otu_table slot.
phyloseq-class
otu_table-class
otu_table
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ## Not run:
library(theseus)
library(phyloseq)
data(WWTP_Impact, package='theseus')
dim(otu_table(WWTP_Impact))
taxa_are_rows(WWTP_Impact)
otu <- pstoveg_otu(WWTP_Impact)
dim(otu)
data(GlobalPatterns, package='phyloseq')
dim(otu_table(GlobalPatterns))
taxa_are_rows(GlobalPatterns)
otu.gp <-pstoveg_otu(GlobalPatterns)
dim(otu.gp)
# move transformed OTU table back to phyloseq
wwtp <- WWTP_Impact
otu.ra <- vegan::decostand(otu, method='total')
otu_table(wwtp) <- otu_table(otu.ra,
taxa_are_rows = taxa_are_rows(WWTP_Impact))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.