plot.EventProbabilities {rpact}R Documentation

Event Probabilities Plotting


Plots an object that inherits from class EventProbabilities.


## S3 method for class 'EventProbabilities'
  allocationRatioPlanned = x$allocationRatioPlanned,
  main = NA_character_,
  xlab = NA_character_,
  ylab = NA_character_,
  type = 1L,
  legendTitle = NA_character_,
  palette = "Set1",
  plotPointsEnabled = NA,
  legendPosition = NA_integer_,
  showSource = FALSE,
  plotSettings = NULL



The object that inherits from EventProbabilities.


An optional object that inherits from NumberOfSubjects.


Optional plot arguments. At the moment xlim and ylim are implemented for changing x or y axis limits without dropping data observations.


The planned allocation ratio n1 / n2 for a two treatment groups design, default is 1. For multi-arm designs, it is the allocation ratio relating the active arm(s) to the control. For simulating means and rates for a two treatment groups design, it can be a vector of length kMax, the number of stages. It can be a vector of length kMax, too, for multi-arm and enrichment designs. In these cases, a change of allocating subjects to treatment groups over the stages can be assessed. Note that internally allocationRatioPlanned is treated as a vector of length kMax, not a scalar.


The main title.


The x-axis label.


The y-axis label.


The plot type (default = 1). Note that at the moment only one type is available.


The legend title, default is "".


The palette, default is "Set1".


Logical. If TRUE, additional points will be plotted.


The position of the legend. By default (NA_integer_) the algorithm tries to find a suitable position. Choose one of the following values to specify the position manually:

  • -1: no legend will be shown

  • NA: the algorithm tries to find a suitable position

  • 0: legend position outside plot

  • 1: legend position left top

  • 2: legend position left center

  • 3: legend position left bottom

  • 4: legend position right top

  • 5: legend position right center

  • 6: legend position right bottom


Logical. If TRUE, the parameter names of the object will be printed which were used to create the plot; that may be, e.g., useful to check the values or to create own plots with the base R plot function. Alternatively showSource can be defined as one of the following character values:

  • "commands": returns a character vector with plot commands

  • "axes": returns a list with the axes definitions

  • "test": all plot commands will be validated with eval(parse()) and returned as character vector (function does not stop if an error occurs)

  • "validate": all plot commands will be validated with eval(parse()) and returned as character vector (function stops if an error occurs)

Note: no plot object will be returned if showSource is a character.


An object of class PlotSettings created by getPlotSettings().


Generic function to plot an event probabilities object.

Generic function to plot a parameter set.


Returns a ggplot2 object.

[Package rpact version 4.0.0 Index]