getchunk: Return consecutive time chunks

Description Usage Arguments Value Examples

Description

Split data frame into consecutive chunks based on the column time and two pre-defined chunk-related thresholds.

Usage

1
getchunk(df, max_gap = 600, min_len = 10)

Arguments

df

a data frame with a column named 'time' and of class 'POSIXct'

max_gap

maximum time gap allowed to be counted as one chunk [s]

min_len

minimum length of a chunk

Value

a list of splitted chunks

Examples

1
2
3
4
5
## Not run: 
 chn1 <- getchunk(df)
 chn2 <- getchunk(df, max_gap = 100, min_len = 0)

## End(Not run)

sunsiyu/timelyr documentation built on May 30, 2019, 8:40 p.m.