dts_lag | R Documentation |
Lag (or lead) columns in a Date Time Series data frame
dts_lag(
x,
dtt = "DateTime",
colname = dts_colnames(x),
n = 1L,
units = dtt_units(x[[dtt]])
)
dts_lead(
x,
dtt = "DateTime",
colname = dts_colnames(x),
n = 1L,
units = dtt_units(x[[dtt]])
)
dts_delay(
x,
dtt = "DateTime",
colname = dts_colnames(x),
n = 1L,
units = dtt_units(x[[dtt]])
)
x |
A date/time vector. |
dtt |
A string specifying the column with the Date or POSIXct values. |
colname |
A character vector specifying the column(s) with the other values. |
n |
A int (integer scalar) of the lag. |
units |
A string of the lag time units. |
dts_lag(dts_data[1:4,], n = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.