get_taxadf | R Documentation |
get the data of specified taxonomy
get_taxadf(obj, ...)
## S4 method for signature 'phyloseq'
get_taxadf(obj, taxlevel = 2, type = "species", ...)
## S4 method for signature 'data.frame'
get_taxadf(
obj,
taxda,
taxa_are_rows,
taxlevel,
sampleda = NULL,
type = "species",
...
)
obj |
phyloseq, phyloseq class or data.frame the shape of data.frame (nrow sample * column feature taxa_are_rows set FALSE, nrow feature * ncol sample, taxa_are_rows set TRUE). |
... |
additional parameters. |
taxlevel |
character, the column names of taxda that you want to get. when the input is phyloseq class, you can use 1 to 7. |
type |
character, the type of datasets, default is "species", if the dataset is not about species, such as dataset of kegg function, you should set it to "others". |
taxda |
data.frame, the classifies of feature contained in obj(data.frame). |
taxa_are_rows |
logical, if the column of data.frame are features, it should be set FALSE. |
sampleda |
data.frame, the sample information. |
phyloseq class contained tax data.frame and sample information.
Shuangbin Xu
## Not run:
library(ggplot2)
data(test_otu_data)
test_otu_data %<>% as.phyloseq()
phytax <- get_taxadf(test_otu_data, taxlevel=2)
phytax
head(phyloseq::otu_table(phytax))
phybar <- ggbartax(phytax) +
xlab(NULL) + ylab("relative abundance (%)")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.