box_plot: Box Plot

View source: R/batch_detection.R

box_plotR Documentation

Box Plot

Description

This function draws side-by-side box plots for each batch.

Usage

box_plot(
    df,
    title = NULL,
    batch.legend.title = "Batch",
    ylab = "Value",
    color.set = NULL,
    x.angle = 0,
    x.hjust = 0.5,
    x.vjust = 0.5
)

Arguments

df

A data frame used to draw the box plots.

title

Character, the plot title.

batch.legend.title

Character, the legend title of batches.

ylab

Character, y-axis title.

color.set

A vector of character, indicating the set of colors to use. The colors are represented by hexadecimal color code.

x.angle

Numeric, angle of x axis, in the range of 0 to 360.

x.hjust

Numeric, horizontal justification of x axis, in the range of 0 to 1.

x.vjust

Numeric, vertical justification of x axis, in the range of 0 to 1.

Value

None.

Author(s)

Yiwen Wang, Kim-Anh LĂȘ Cao

See Also

Scatter_Density, density_plot, alignment_score and partVar_plot as the other methods for batch effect detection and batch effect removal assessment.

Examples

# The first example
library(TreeSummarizedExperiment) # for functions assays(),rowData()
data('AD_data')
# centered log ratio transformed data
ad.clr <- assays(AD_data$EgData)$Clr_value
ad.batch <- rowData(AD_data$EgData)$Y.bat # batch information
names(ad.batch) <- rownames(AD_data$EgData)
ad.df <- data.frame(value = ad.clr[,1], batch = ad.batch)
box_plot(df = ad.df, title = 'OTU 12', x.angle = 30)

# The second example
colorlist <- rainbow(10)
box_plot(df = ad.df, title = 'OTU 12', color.set = colorlist, x.angle = 30)


EvaYiwenWang/PLSDAbatch documentation built on Jan. 19, 2024, 11:19 p.m.