Skip to contents

Set Up a Time Series Configuration

Usage

setup_TimeSeriesConfig(
  x = NULL,
  y = NULL,
  group = NULL,
  x2 = NULL,
  y2 = NULL,
  window = 7L,
  roll_fn = "none",
  align = "center",
  roll_width = 2,
  roll_color = NULL,
  raw_opacity = 0.5,
  points = TRUE,
  xlab = NULL,
  ylab = NULL,
  y2lab = NULL,
  palette = NULL,
  zoom = FALSE,
  title = NULL,
  dat_path = NULL,
  origin = NULL,
  writer = NULL,
  legend_position = "top",
  legend_placement = "outside",
  zt = NULL,
  shade_bin = NULL,
  show_zt_every = 1L
)

Arguments

x, y

Optional Character: Time and value column bindings. Multiple y columns share x; group splits a single y column.

group

Optional Character: Group column binding.

x2, y2

Optional Character: Secondary time/value bindings. Unset x2 uses x.

window

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

roll_fn

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

align

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

roll_width

Numeric (0, Inf): Rolling line width in pixels.

roll_color

Optional Character: Rolling line color; unset uses the group color.

raw_opacity

Numeric [0, 1]: Raw observation opacity.

points

Logical: Show raw points; FALSE draws raw lines.

xlab, ylab

Optional Character: Axis labels. NULL derives them from the data.

y2lab

Optional Character: Secondary axis name.

palette

Optional Character: Series colors, overriding the theme palette for this chart. NULL uses the theme's.

zoom

Logical: Enable the zoom control.

title

Optional Character: Chart title. Declared here because it is the one property every chart type has; palette is not (four take a colormap instead), and axis labels and margins are cartesian-only.

dat_path

Optional Character: Path to the data, read at draw time. The serializable alternative to passing data to draw().

origin

Optional Named character {"user", "default", "derived"}: Where each value came from, one entry per settable property. Absent on an authored config; written by the interface that resolved it.

writer

Optional Named character: Which interface wrote the config, as name and version. Absent on an authored config.

legend_position

Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row.

legend_placement

Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend.

zt, shade_bin

Optional Character: Columns of zeitgeber labels and zero/one shading flags.

show_zt_every

Integer [1, Inf): Zeitgeber label stride; phase zero remains visible.

Value

TimeSeriesConfig: Validated settings.

Examples

draw(setup_TimeSeriesConfig(x = "Time", y = "demand"), data = BOD)