duration
to a data.table
with column time
.Adds a column duration
to a data.table
with column time
,
the most recent time given a duration of 1, the second most recent time
given a duration of 2, and so on. This function modifies the input
table.
add_duration(d, keys = NULL, silent = TRUE)
A data.table
containing at least a column time
,
which is sortable. For example, could be POSIXct dates.
A character vector for the columns you wish the output table to be keyed by.
Should the table be modified and this function return nothing (silent = TRUE), or should the function return the modified table (silent = FALSE).
The input data.table
, with a column duration
added.