View source: R/plot-ggbartaxa.R
ggbartax | R Documentation |
taxonomy barplot
ggbartax(obj, ...)
ggbartaxa(obj, ...)
## S3 method for class 'phyloseq'
ggbartax(obj, ...)
## S3 method for class 'data.frame'
ggbartax(
obj,
mapping = NULL,
position = "stack",
stat = "identity",
width = 0.7,
topn = 30,
count = FALSE,
sampleda = NULL,
factorLevels = NULL,
sampleLevels = NULL,
facetNames = NULL,
plotgroup = FALSE,
groupfun = mean,
...
)
obj |
phyloseq, phyloseq class or data.frame, (nrow sample * ncol feature (factor)) or the data.frame for geom_bar. |
... |
additional parameters, see |
mapping |
set of aesthetic mapping of ggplot2, default is NULL, if the data is the data.frame for geom_bar, the mapping should be set. |
position |
character, default is 'stack'. |
stat |
character, default is 'identity'. |
width |
numeric, the width of bar, default is 0.7. |
topn |
integer, the top number of abundance taxonomy(feature). |
count |
logical, whether show the relative abundance. |
sampleda |
data.frame, (nrow sample * ncol factor), the sample information, if the data doesn't contain the information. |
factorLevels |
vector or list, the levels of the factors (contained names e.g. list(group=c("B","A","C")) or c(group=c("B","A","C"))), adjust the order of facet, default is NULL, if you want to order the levels of factor, you can set this. |
sampleLevels |
vector, adjust the order of x axis e.g. c("sample2", "sample4", "sample3"), default is NULL. |
facetNames |
character, default is NULL. |
plotgroup |
logical, whether calculate the mean or median etc for each group, default is FALSE. |
groupfun |
character, how to calculate for feature in each group, the default is 'mean', this will plot the mean of feature in each group. |
barplot of tax
Shuangbin Xu
## Not run:
library(ggplot2)
data(test_otu_data)
test_otu_data %<>% as.phyloseq()
otubar <- ggbartax(test_otu_data) +
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.