Plots simulation results.
Arguments
- x
The simulation results, obtained from
getSimulationSurvival().- y
Not available for this kind of plot (is only defined to be compatible to the generic plot function).
- ...
Optional plot arguments. At the moment
xlimandylimare implemented for changing x or y axis limits without dropping data observations.- main
The main title.
- xlab
The x-axis label.
- ylab
The y-axis label.
- type
The plot type (default =
1). The following plot types are available:1: creates a 'Overall Success' plot (multi-arm and enrichment only)2: creates a 'Success per Stage' plot (multi-arm and enrichment only)3: creates a 'Selected Arms per Stage' plot (multi-arm and enrichment only)4: creates a 'Reject per Stage' or 'Rejected Arms per Stage' plot5: creates a 'Overall Power and Early Stopping' plot6: creates a 'Expected Number of Subjects and Power / Early Stop' or 'Expected Number of Events and Power / Early Stop' plot7: creates an 'Overall Power' plot8: creates an 'Overall Early Stopping' plot9: creates an 'Expected Sample Size' or 'Expected Number of Events' plot10: creates a 'Study Duration' plot (non-multi-arm and non-enrichment survival only)11: creates an 'Expected Number of Subjects' plot (non-multi-arm and non-enrichment survival only)12: creates an 'Analysis Times' plot (non-multi-arm and non-enrichment survival only)13: creates a 'Cumulative Distribution Function' plot (non-multi-arm and non-enrichment survival only)14: creates a 'Survival Function' plot (non-multi-arm and non-enrichment survival only)"all": creates all available plots and returns it as a grid plot or list
- palette
The palette, default is
"Set1".- theta
A vector of standardized effect sizes (theta values), default is a sequence from -1 to 1.
- plotPointsEnabled
Logical. If
TRUE, additional points will be plotted.- legendPosition
The legend position. The default,
"auto", measures the legend and chooses among six inside positions by minimizing overlap with points, line segments, reference lines, bars, boxes, and error bars. Long labels are wrapped and entries arranged vertically in automatic mode. Oversized legends and faceted plots use the outside right position. This heuristic uses the current graphics device (seven inches square when no device is open); resizing may require recreating the plot or setting a position explicitly. Manual positions are:-1or"none": hide the legend"left","right","bottom","top": outside the plot0: default outside position with a square aspect ratio1,2,3: inside left, at the top, centre, or bottom4,5,6: inside right, at the top, centre, or bottomNA: retain the legacy plot-specific positioning rules
- showSource
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 Rplotfunction. AlternativelyshowSourcecan 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 witheval(parse())and returned as character vector (function does not stop if an error occurs)"validate": all plot commands will be validated witheval(parse())and returned as character vector (function stops if an error occurs)
Note: no plot object will be returned if
showSourceis a character.- grid
An integer value specifying the output of multiple plots. By default (
1) a list ofggplotobjects will be returned. If agridvalue > 1 was specified, a grid plot will be returned if the number of plots is <= specifiedgridvalue; a list ofggplotobjects will be returned otherwise. Ifgrid = 0is specified, all plots will be created usingprintcommand and a list ofggplotobjects will be returned invisible. Note that one of the following packages must be installed to create a grid plot: 'ggpubr', 'gridExtra', or 'cowplot'.- plotSettings
An object of class
PlotSettingscreated bygetPlotSettings().
Details
For piecewise multi-arm and enrichment survival simulations, scenario plots use situation positions on the x-axis, labeled with the specification's situation names, including simulations with one arm or one subgroup. First-interval hazard ratios are not used as scenario coordinates.
Generic function to plot all kinds of simulation results.
Examples
if (FALSE) { # \dontrun{
results <- getSimulationMeans(
alternative = 0:4, stDev = 5,
plannedSubjects = 40, maxNumberOfIterations = 1000
)
plot(results, type = 5)
} # }
