library(rtemis.draw)
Attaching package: 'rtemis.draw'
The following object is masked from 'package:graphics':
Axis
Attaching package: 'rtemis.draw'
The following object is masked from 'package:graphics':
Axis
draw_ts() adds rolling summaries to ordered observations. draw_xt() compares series that share a time scale, with an optional second value axis and separate observation times. Numeric, Date, and POSIXct coordinates retain their spacing.
The air-quality data record daily measurements in New York from May through September 1973. A seven-observation mean smooths the daily ozone measurements:
A window counts observations, rather than elapsed days. Here there is one row per day, including days with missing ozone measurements. A window containing a missing value remains missing. The summary and observations share a legend entry, so selecting a series toggles both layers.
A second value axis lets each measurement retain its units:
For observations collected on a different schedule, supply their times in x2 along with y2. Missing values break the raw line; they are not replaced or connected across the gap.
The same controls are available through column bindings:
zt and shade_bin bind optional columns containing zeitgeber phase labels and zero/one shading flags. show_zt_every controls label density while retaining phase zero. These use one shared time vector. Shading runs span their first and last observation; an isolated flag has no duration. For known interval endpoints, pass explicit shade_interval pairs to draw_xt().
For distributions within time periods, form explicit calendar groups and use the ordinary boxplot API: