plot.rtforecast: Plot method for rtforecast objects

View source: R/plot_rtforecast.R

plot.rtforecastR Documentation

Plot method for rtforecast objects

Description

Draws to the current graphics device (matches normal R plotting conventions - use grDevices::png()/grDevices::pdf() yourself around the call if you want a file, the way you would for any base R plot). Ports the "current situation" view from the original run_rtforecast.R script.

Usage

## S3 method for class 'rtforecast'
plot(
  x,
  which = c("Rt", "forecast", "observed_vs_predicted"),
  n_recent = 8,
  ...
)

Arguments

x

an "rtforecast" object, as returned by rt_forecast()

which

one of "Rt" (filtered vs smoothed R_t), "forecast" (recent observed/predicted cases + one-step forecast), or "observed_vs_predicted" (full-period observed vs in-sample predicted + forecast)

n_recent

for which = "forecast", how many recent time points to show (default 8)

...

passed on to the underlying graphics::plot() call

Value

The input "rtforecast" object x, returned invisibly. Called primarily for its side effect of drawing to the current graphics device.


RtForecastR documentation built on Nov. 25, 2026, 9:09 a.m.