Description Usage Arguments Details Value See Also Examples

View source: R/exceeds_tumbling_sum.R

The tumbling sum is calculated as the partial cumulative sum of a vector
until a threshold is exceeded. Once this happens, the tumbling sum is
calculated from zero again. `exceeds_tumbling_sum()`

returns `TRUE`

whenever
this threshold is hit/exceeded and `FALSE`

otherwise.

1 | ```
exceeds_tumbling_sum(x, threshold, inclusive = TRUE)
``` |

`x` |
a |

`threshold` |
a |

`inclusive` |
a |

This is for example useful if you have high frequency GPS positions
and want to keep only points that are at least `x`

seconds apart.

a `logical`

vector of the same length as `x`

that is `TRUE`

whenever
`threshold`

was exceeded and `FALSE`

otherwise

`MESS::cumsumbinning()`

does something very similar, but returns
group indices instead of a logical vector.

1 | ```
exceeds_tumbling_sum(c(1, 3, 3, 3), 4)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.