Applies a given function on a vector by rolling over it with a sliding window mechanism.
roll(intervals, width, fun, ...)vector
window size
function to be applied
additional arguments for FUN
(list) List with return values of fun for each window
This method was inspired by the function "wapply" by A. N. Spiess, University Hospital Hamburg-Eppendorf (https://rmazing.wordpress.com/2013/04/23/wapply-a-faster-but-less-functional-rollapply-for-vector-setups/), but adjusted for this package to speed it up.