Learn R Programming

scanstatistics (version 0.1.0)

times_and_durations: Creates a data.table with columns time and duration.

Description

Creates a data.table with columns time and duration, in which the column time corresponds to the (unique) times in the input table. In the output, the most recent time given a duration of 1, the second most recent time given a duration of 2, and so on.

Usage

times_and_durations(d)

Arguments

d

A data.table containing at least a column time, which is sortable. For example, could be POSIXct dates.

Value

A new data.table, containing columns time (key column) and duration.