plot_box | R Documentation |
This function displays each sample's omic data distribution as a box and whisker plot.
plot_box( dat, group = NULL, pal_group = "npg", type = NULL, ylab = NULL, title = "Box Plot", legend = "right", hover = FALSE )
dat |
Omic data matrix or matrix-like object with rows corresponding to
probes and columns to samples. Raw counts stored in |
group |
Optional character or factor vector of length equal to sample size. Numeric or logical vectors are silently coerced to factor. Levels are used to color box plots. If supplied, legend title defaults to "Group". Override this feature by passing a named list instead. |
pal_group |
String specifying the color palette to use if |
ylab |
Optional label for y-axis. |
title |
Optional plot title. |
legend |
Legend position. Must be one of |
hover |
Show sample name by hovering mouse over data point? If |
Box plots offer an intuitive way to visualize an omic data distribution. They
are common in quality control pipelines, and may be especially helpful when
contrasting pre- and post-normalization matrices. plot_box
can
additionally be used to inspect for batch effects or associations with
phenotypic factors by using the group
argument.
# Box plots by sample mat <- matrix(rnorm(500 * 10), nrow = 500, ncol = 10) plot_box(mat) # Box plots by group grp <- rep(c("A", "B"), each = 5) plot_box(mat, group = grp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.