Skip to contents

Plots multiple fitted rga objects on a single set of axes, using distinct colors per model. Observed data points, fitted lines, and optional confidence bounds are drawn for every model. Models may have been fit to different datasets.

Usage

overlay_rga(
  models,
  conf_bounds = TRUE,
  legend = TRUE,
  legend_pos = "bottomright",
  colors = NULL,
  log = FALSE,
  ...
)

Arguments

models

A named or unnamed list of objects of class rga. At least one model must be provided. If the list is named, those names are used as legend labels; otherwise labels default to "Model 1", "Model 2", etc.

conf_bounds

Logical; draw confidence bounds for each model (default: TRUE).

legend

Logical; draw a legend (default: TRUE).

legend_pos

Legend position keyword (default: "bottomright").

colors

Optional character vector of colors, one per model. If NULL (default), palette() colors are cycled.

log

Logical; use log-log axes (default: FALSE).

...

Additional arguments passed to the initial plot() call (e.g., main, xlab, ylab). Not forwarded to subsequent lines() or points() calls.

Value

Invisibly returns NULL.

See also

Examples

t1 <- c(100, 200, 300, 400, 500)
f1 <- c(1, 2, 1, 3, 2)
t2 <- c(150, 300, 450, 600, 750)
f2 <- c(2, 1, 3, 2, 4)
m1 <- rga(t1, f1)
m2 <- rga(t2, f2)
overlay_rga(list(System_A = m1, System_B = m2),
  main = "RGA Overlay", xlab = "Cumulative Time",
  ylab = "Cumulative Failures"
)