Takes the last row for each group identified by columns identified in ...
Arguments
- stream
data.table in a stream format
- ...
<
dynamic-dots
> columns to group by for debouncing
Examples
stream <- data.table::data.table(
x = 0:48, y = rep(0:4, 12)
)
#> Warning: Item 1 has 49 rows but longest item has 60; recycled with remainder.
data.table::setkey(stream, x)
stream_debounce(stream, "y")
#> y x
#> <int> <int>
#> 1: 0 45
#> 2: 4 44
#> 3: 1 46
#> 4: 2 47
#> 5: 3 48