Description Usage Arguments Author(s) Examples
This function uses the ggplot2 package to generate a boxplot from a givin
SummarizedPhyloseq-class
object by specifying a taxon name.
1 | plot_boxplot(spy, level, taxon, x, rows, cols, line, color, ...)
|
spy |
|
level |
character. The phylogenic level. |
taxon |
character. The taxon name to plot. |
line |
character. A sample meta-data variable. If specified, geom_line will be called to draw lines between 2 points. This is particually usful to deal with repeated measures. |
by |
character. The sample meta-data variable to plot the abundance data againt to. It must be from the sample data's column names. If multiple variables are givin, facets will be used. The default is sample name. See examples. |
color.by |
character. A sample meta-data variable. If specified, points with different levels will be colored diffently. See examples. |
jitter |
numeric. If specified, points will be jittered. Recommanded
value: 0.15. the |
point.size |
numeric. The size of points. Default is 3 |
point.alpha |
numeric. The transparency of points. |
point.color |
character. If the |
whisker.width |
numeirc. The width of boxplot whisker. Default is 0.5. |
color.pal |
character. The color panel to use. |
show.legend |
logical. Whether to show legend. Default is TRUE. |
syle |
character. The pre-defined style to apply on the plot. "bw" is a
empty default style using the |
plotly |
logical. If TRUE, a plotly variable will be returned. |
Chenghao Zhu
1 2 3 4 5 6 | data(fatigue)
fatigue = transform_sample_counts(fatigue, function(x) x/sum(x))
spy = summarizeFromPhyloseq(fatigue)
plot_box(spy, level = "Genus", taxon = "g__Ruminococcus", by = "Subject", jitter = 0.15)
plot_box(spy, level = "Genus", taxon = "g__Ruminococcus", by = c("Subject","Sex"), box.size = 1, whisker.size = 1, show.points = F, style = "academic")
plot_box(spy, level = "Genus", taxon = "g__Ruminococcus", by = c("Subject","Sex"), jitter = 0.15, box.size = 1, whisker.size = 1, point.alpha = 0.75, point.color = "steelblue", style = "academic")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.