decision_plot: Decision map plot

View source: R/decision_plot.r

decision_plotR Documentation

Decision map plot

Description

This function creates a decision plot containing customizable decision zones.

Usage

decision_plot(
  filename,
  filetype = c("png", "pdf", "svg"),
  xlab = "Toxicity Probability",
  ylab = "Efficacy Probability",
  x_breaks = c(0, 1),
  y_breaks = c(0, 1),
  x_labels = c(0, 1),
  y_labels = c(0, 1),
  zones = list(),
  legend_info = list(labels = NULL, colors = NULL),
  title = NULL,
  title_pos = c(0.05, 1.1),
  legend_pos = c(0.3, 1.2),
  grid_lines = TRUE,
  plot_size = c(7, 7)
)

Arguments

filename

File path.

filetype

File type.

xlab

x-axis label. (Default is "Toxicity Probability")

ylab

y-axis label. (Default is "Efficacy Probability")

x_breaks

Numeric vector for x-axis major ticks. (Default is 'c(0, 1')

y_breaks

Numeric vector for y-axis major ticks. (Default is 'c(0, 1')

x_labels

Labels corresponding to x_breaks. (Default is 'c(0, 1')

y_labels

Labels corresponding to y_breaks. (Default is 'c(0, 1')

zones

A list of rectangular zones to draw, where each rectangle is a list with elements xmin, xmax, ymin, ymax, and color.

legend_info

A list with two elements: labels (character vector) and colors (character vector) for the legend.

title

Title of plot. (Default is 'NULL')

title_pos

A numeric vector (x, y) indicating the position of the title text.

legend_pos

A numeric vector (x, y) indicating the position of the legend.

grid_lines

Whether to include background grid lines. (Default is TRUE.)

plot_size

A numeric vector indicating width and height. (Default is c(7, 7)).

Value

No return value, called for side effects.

Examples

zones <- list(list(xmin = 0.0, xmax = 0.2, ymin = 0, ymax = 1.0, color = "#a8eea8"),
              list(xmin = .2, xmax = .3, ymin = 0, ymax = 0.6, color = "#a8eea8"),
              list(xmin = .2, xmax = .3, ymin = .6, ymax = 1, color = "#a8d5ee"))
tmpfile <- tempfile(fileext = ".png")
decision_plot(tmpfile, filetype = "png", zones = zones, title = "Decision Zones")


phase12designs documentation built on Sept. 2, 2025, 9:09 a.m.