Skip to contents

Produces a multi-panel plot of exposure analysis results. The default layout shows cumulative exposure and cumulative events versus time (top panel), the number of systems at risk over time (middle panel), and the event rate over time (bottom panel). Alternatively, a single which panel can be selected.

Usage

# S3 method for class 'exposure'
plot(
  x,
  which = c("all", "exposure", "at_risk", "event_rate"),
  legend = TRUE,
  legend_pos = "topleft",
  ...
)

Arguments

x

An object of class exposure.

which

Character string selecting which panel(s) to plot. One of "all" (default), "exposure", "at_risk", or "event_rate".

legend

Logical; show the legend (default: TRUE).

legend_pos

Position of the legend (default: "topleft").

...

Additional arguments passed to the underlying plot().

Value

Invisibly returns NULL.

Examples

id   <- c(1, 1, 1, 2, 2, 2, 3, 3, 3, 3)
time <- c(100, 350, 500, 80, 300, 600, 150, 250, 400, 700)
result <- exposure(id, time)
plot(result)

plot(result, which = "exposure")