View source: R/decision_plot.r
decision_plot | R Documentation |
This function creates a decision plot containing customizable decision zones.
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)
)
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 |
y_labels |
Labels corresponding to |
zones |
A list of rectangular zones to draw, where each rectangle is a list with elements |
legend_info |
A list with two elements: |
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)). |
No return value, called for side effects.
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.