Skip to contents

Draw Time Series with Rolling Summaries

Usage

draw_ts(
  x,
  time,
  window = 7L,
  group = NULL,
  roll_fn = "mean",
  align = "center",
  ...,
  theme = NULL,
  width = NULL,
  height = NULL,
  element_id = NULL,
  filename = NULL
)

Arguments

x

Numeric or named list: Observations.

time

Numeric, Date, POSIXct, or list: Shared or per-series times.

window

Integer [1, Inf): Number of observations per rolling window.

group

Optional vector: Group identities for one series.

roll_fn

Character {"none", "mean", "median", "min", "max", "sum"}: Summary.

align

Character {"center", "left", "right"}: Window alignment.

...

Additional settings passed to setup_TimeSeriesConfig().

theme

Optional Theme: Theme override. The palette inside the theme can be overridden per-chart with the color argument.

width

Optional Character or Numeric: Widget width.

height

Optional Character or Numeric: Widget height.

element_id

Optional Character: Explicit DOM element ID for the widget container. NULL lets htmlwidgets generate one.

filename

Optional Character: If provided, save the widget to this file via save_drawing().

Value

htmlwidget: Raw observations and rolling curves with shared group legends.

Examples

draw_ts(BOD$demand, BOD$Time, window = 3L)