Skip to contents

R6 class for mapping variable to data for boxplot visualizations. This class extends MappedData to provide specialized mapping functionality for box-and-whisker plots, including handling of discrete and continuous x-axis scales and automatic grouping logic.

See also

Super class

MappedData -> MappedDataBoxplot

Public fields

xScale

scale of x axis

xScaleArgs

arguments for scale of x axis

hasXmapping

boolean, if TRUE x is mapped

Active bindings

boxwhiskerMapping

mapping for box whisker plot

Methods

Inherited methods


MappedDataBoxplot$new()

Create a new MappedDataBoxplot object

Usage

MappedDataBoxplot$new(
  data,
  mapping,
  groupAesthetics = NULL,
  direction = "y",
  isObserved = TRUE,
  xlimits = NULL,
  ylimits = NULL,
  xScale = AxisScales$linear,
  yScale = AxisScales$linear
)

Arguments

data

data.frame used for mapping

mapping

list of aesthetic mappings

groupAesthetics

vector of aesthetics, which are used for columns mapped with aesthetic groupby

direction

direction of plot either "x" or "y"

isObserved

A boolean if TRUE mappings mdv, lloq, error and error_relative are evaluated

xlimits

limits for x-axis (may be NULL)

ylimits

limits for y-axis (may be NULL)

xScale

scale of x-axis either 'linear' or 'log'

yScale

scale of y-axis either 'linear' or 'log'

Returns

MappedDataBoxplot class object use Metadata to adjust binning of x-axis, and group aesthetic


MappedDataBoxplot$doAdjustmentsWithMetaData()

Usage

MappedDataBoxplot$doAdjustmentsWithMetaData(
  originalmapping,
  xScale,
  xScaleArgs
)

Arguments

originalmapping

mapping provided by user

xScale

either 'linear','log', 'discrete' or 'auto' (default) auto select linear for continuous data and discrete for categorical data

xScaleArgs

list of arguments passed to ggplot2::scale_x_continuous(), ggplot2::scale_x_log10() or ggplot2::scale_x_discrete()

Returns

adjusted MappedDataBoxplot class object


MappedDataBoxplot$clone()

The objects of this class are cloneable with this method.

Usage

MappedDataBoxplot$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

if (FALSE) { # \dontrun{
# Create boxplot mapping with continuous x variable
boxplotData <- MappedDataBoxplot$new(
  data = myDataFrame,
  mapping = aes(x = dose, y = concentration),
  xScale = "linear"
)

# Create boxplot mapping with categorical x variable
boxplotData <- MappedDataBoxplot$new(
  data = myDataFrame,
  mapping = aes(x = treatment_group, y = response),
  xScale = "discrete"
)
} # }