View source: R/generic_utilities.R
byWin | R Documentation |
Applies a function over moving windows
byWin(
x,
WIN,
INC,
flex = TRUE,
FUN,
...,
position = c("mid", "first", "last"),
cores = 1
)
wapply(
x,
WIN,
INC,
flex = TRUE,
FUN,
...,
position = c("mid", "first", "last"),
cores = 1
)
x |
a rats object or another object for which as.rats methods are available |
WIN |
integer. the window size in the time unit of x (e.g. seconds) |
INC |
integer. the increment size in the time unit of x (e.g. seconds) |
flex |
logical. Creates additional shorter windows at the start and end of the signal to maximize the coverage of the original series |
FUN |
The function to be executed |
... |
Additional parameters to be passed to FUN |
position |
Should the time value of each calculation be positioned as the first, middle or last sample of each window? |
cores |
integer or logical. The number of cores to be used for parallelization. if set to 1 or FALSE, parallelization is turned off. If set to TRUE, cores are automatically selected. Please note that most simple tasks can be faster if run as single core due to the overhead of scheduling the task and returning the result can be greater than the time to execute the task itself, resulting in poor performance. |
a rats time series with a $x element pointing to the windowed position of $y elements
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.