timetable

Methods

Method Reference: timetable.lag

timetable: ttB = lag (ttA)
timetable: ttB = lag (ttA, n)

Shift the data of a timetable along its own row times.

ttB = lag (ttA) moves every value one row later, leaving the first row missing and dropping what fell off the end. The row times themselves do not move, so the values arrive against later times than the ones they were recorded at.

n says how far, as a whole number of rows, as a duration that must be a multiple of the time step, or as a calendarDuration whose unit the timetable must be regular in. A negative n moves the values earlier instead, and a lag past the height of the timetable leaves every row missing.

The timetable must be regular: a shift by rows only means anything when the rows are evenly spaced, and a timetable of one row or of none is not regular.

A row left with no value takes the missing value of its variable’s own type, which for a logical variable is false and for a character one a space, neither type having a missing value of its own. Every property of the timetable survives.

See also: retime, synchronize, isregular, timetable

Source Code: timetable