Skip to contents

Producing box-and-whisker plots

Usage

plotBoxWhisker(
  data,
  metaData = NULL,
  outliers = NULL,
  dataMapping = NULL,
  plotConfiguration = NULL,
  plotObject = NULL
)

Arguments

data

A data.frame to use for plot.

metaData

A named list of information about data such as the dimension and unit of its variables.

outliers

Logical defining if outliers should be included in boxplot

dataMapping

A BoxWhiskerDataMapping object mapping x, y and aesthetic groups to their variable names of data.

plotConfiguration

An optional BoxWhiskerConfiguration object defining labels, grid, background and watermark.

plotObject

An optional ggplot object on which to add the plot layer

Value

A ggplot object

Examples

# Produce box-and-whisker plots of log-normal distributed data
boxData <- data.frame(x = c(rep("A", 500), rep("B", 500)), y = rlnorm(1000))

plotBoxWhisker(data = boxData, dataMapping = BoxWhiskerDataMapping$new(x = "x", y = "y"))


# Remove outliers from boxplot
plotBoxWhisker(
  data = boxData,
  dataMapping = BoxWhiskerDataMapping$new(x = "x", y = "y"),
  outliers = FALSE
)