Description Usage Arguments Details Value Author(s) Examples
This function do a barplot to show the distribution of selected taxa in each level of a given metadata variable
1 2 3 4 5 |
data |
a list of otu tables or taxonomic abundance matrices.
See also |
is.OTU |
logical. If an OTU table was provided, |
rank |
a single taxonomic rank.
See also |
taxa |
a vector containing taxa names for plotting. |
meta |
the metadata table to be used
(must have same samples as |
meta.factor |
a character string. Must be one of the metadata variables. |
func |
function to be used to aggregate count data, e.g. "sum" or "mean", default is "sum" |
cex.y |
size of y axis tick labels. |
cex.x |
size of x axis tick labels. |
cex.main |
size of title. |
bar.width |
width of bars |
RAM.theme |
customized ggplot_theme in RAM. See also ?theme_ggplot. |
col.pal |
color palettes to be used. |
main |
a character string. The title of the plot, default is an empty string. |
file |
filename to save the plot. |
ext |
filename extension, the type of image to be saved to. |
width |
an integer, width of the plot. |
height |
an integer, height of the plot. |
To use customized color palettes, must pass a vector of color names or hexadecimals. See examples for detail.
This function returns a barplot.
Wen Chen
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | data(ITS1, ITS2, meta)
taxa <- c("Fusarium", "Alternaria", "Cladosporium")
group.Taxa.bar(data=list(ITS1=ITS1, ITS2=ITS2), is.OTU=TRUE,
rank="g", taxa=taxa, meta=meta,
meta.factor="City", cex.y=5, cex.x=5,
bar.width=1, RAM.theme=RAM.color())
## Not run:
# change default color schemes
col <- c("dodgerblue1", "darkcyan")
taxa.1 <- c("Fusarium", "Alternaria", "Cladosporium",
"Verticillium", "Kondoa")
group.Taxa.bar(data=list(ITS1=ITS1, ITS2=ITS2), is.OTU=TRUE,
rank="g", taxa=taxa.1, meta=meta,
meta.factor="City", cex.y=5, cex.x=5,
bar.width=1, RAM.theme=NULL, col.pal=col)
group.Taxa.bar(data=list(ITS1=ITS1, ITS2=ITS2), is.OTU=TRUE,
rank="g", taxa=taxa.1, meta=meta,
meta.factor="City", cex.y=5, cex.x=5,
bar.width=1, RAM.theme=NULL,
col.pal=col, func="mean")
# change ggplot theme
group.Taxa.bar(data=list(ITS1=ITS1, ITS2=ITS2), is.OTU=TRUE,
rank="g", taxa=taxa.1, meta=meta,
meta.factor="City", cex.y=5, cex.x=5,
bar.width=1, col.pal=col, RAM.theme=RAM.border())
# save the plot
group.Taxa.bar(data=list(ITS1=ITS1, ITS2=ITS2), is.OTU=TRUE,
rank="g", taxa=taxa.1, meta=meta,
meta.factor="City", cex.y=5, cex.x=5,
bar.width=1, RAM.theme=NULL,
col.pal=col,main="", file="path/to/filename.pdf",
ext="pdf", height=8, width=16)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.