| plot.TrialDesign {rpact} | R Documentation |
Trial Design Plotting
Description
Plots a trial design.
Usage
## S3 method for class 'TrialDesign'
plot(
x,
y,
...,
main = NA_character_,
xlab = NA_character_,
ylab = NA_character_,
type = 1L,
palette = "Set1",
theta = seq(-1, 1, 0.01),
nMax = NA_integer_,
plotPointsEnabled = NA,
legendPosition = NA_integer_,
showSource = FALSE,
grid = 1,
plotSettings = NULL
)
## S3 method for class 'TrialDesignCharacteristics'
plot(x, y, ...)
Arguments
x |
The trial design, obtained from |
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 |
main |
The main title. |
xlab |
The x-axis label. |
ylab |
The y-axis label. |
type |
The plot type (default =
|
palette |
The palette, default is |
theta |
A vector of standardized effect sizes (theta values), default is a sequence from -1 to 1. |
nMax |
The maximum sample size. Must be a positive integer of length 1. |
plotPointsEnabled |
Logical. If |
legendPosition |
The position of the legend.
By default (
|
showSource |
Logical. If
Note: no plot object will be returned if |
grid |
An integer value specifying the output of multiple plots.
By default ( |
plotSettings |
An object of class |
Details
Generic function to plot a trial design.
Generic function to plot a trial design.
Note that nMax is not an argument that it passed to ggplot2.
Rather, the underlying calculations (e.g. power for different theta's or average sample size) are based
on calls to function getPowerAndAverageSampleNumber()
which has argument nMax.
I.e., nMax is not an argument to ggplot2 but to
getPowerAndAverageSampleNumber()
which is called prior to plotting.
Value
Returns a ggplot2 object.
See Also
plot() to compare different designs or design parameters visual.
Examples
## Not run:
design <- getDesignInverseNormal(
kMax = 3, alpha = 0.025,
typeOfDesign = "asKD", gammaA = 2,
informationRates = c(0.2, 0.7, 1),
typeBetaSpending = "bsOF"
)
if (require(ggplot2)) {
plot(design) # default: type = 1
}
## End(Not run)