plotBox: Box plot

View source: R/plotBox.R

plotBoxR Documentation

Box plot

Description

Produces a box-and-whisker plot with a SummarizedExperiment or matrix-like object where rows represent features and columns represent samples.

Usage

plotBox(x, i, group, log2 = FALSE, violin = FALSE, ylab = "Intensity")

Arguments

x

A matrix-like object or SummarizedExperiment object.

i

A string or integer value specifying which assay values to use when x is a SummarizedExperiment object.

group

A discrete variable to visualize the grouping structure.

log2

A logical specifying whether feature intensities needs to be log2-transformed before visualization.

violin

A logical specifying whether a violin plot is shown instead of a boxplot.

ylab

A string specifying the title of y-axis.

Value

A ggplot object.

Examples


data(faahko_se)

## Sample group
g <- colData(faahko_se)$sample_group

## SummarizedExperiment object
plotBox(faahko_se, i = "knn", group = g, log2 = TRUE) # before normalization

## Matrix
m <- assay(faahko_se, "knn_vsn")
plotBox(m, group = g) # after normalization


HimesGroup/qmtools documentation built on April 16, 2023, 8 p.m.