Description Usage Arguments Value See Also
This function groups rows by time difference. A time threshold must be given. If the time difference is longer than time threshold, rows are put in the same group. Otherwise, group number is NA.
1 2 |
df |
a data frame object. |
time |
a POSIXct time object used to calculate time difference |
units |
a character string indicating which units time difference is caluclated in. |
threshold |
a numeric object. Value should have the same unit specified in the |
groupvar |
a character string. The name of a variable that is used to group rows. Time difference is calculated using the earliest and lastest time in each group. Note: data frame is not sorted in the function, recommend to sort before running the function. |
a list of 1 and 0 indicating whether a set of rows are in the same group or not in any groups.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.