Learn R Programming

rpact (version 1.0.0)

TrialDesign_plot: Trial Design Plotting

Description

Plots a trial design.

Usage

# S3 method for TrialDesign
plot(x, y, main = NA_character_, xlab = NA_character_,
  ylab = NA_character_, type = 1, palette = "Set1", theta = seq(-2, 2,
  0.01), nMax = NA_integer_, plotPointsEnabled = NA,
  legendPosition = NA_integer_, ...)

Arguments

y

Not available for this kind of plot (is only defined to be compatible to the generic plot function).

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 'Boundary Plot'

  • 2: creates an 'Average Sample Size and Power / Early Stop' plot

  • 3: creates a 'Stage Levels Plot'

  • 4: creates a 'Power' plot

  • 5: creates a 'Stopping Probability' plot

  • 6: creates an 'Error Spending Plot'

palette

The palette, default is "Set1".

theta

A vector of theta values.

nMax

The maximum sample size.

plotPointsEnabled

If TRUE, additional points will be plotted.

legendPosition

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

...

Optional ggplot2 arguments.

Details

Generic function to plot a trial design.

Generic function to plot a trial design.

See Also

TrialDesignSet_plot to compare different designs or design parameters visual.

Examples

Run this code
# 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
    plot(design, type = 2, nMax = 20, theta = seq(0, 1, 0.05))
    plot(design, type = 3)
    plot(design, type = 4, nMax = 20, theta = seq(0, 1, 0.05))
    plot(design, type = 5, nMax = 20, theta = seq(0, 1, 0.05))
    plot(design, type = 6)
}

# }

Run the code above in your browser using DataLab