slidingWindowComputation: slidingWindowComputation

Description Usage Arguments Note

Description

Function that can compute various measures (e.g mean, SD, max...) of one or several variable (computedVariables) grouped on a sliding window running across another base variable of optional size sizeOfWindow, or with number of bin numberOfBins

Usage

1
2
3
slidingWindowComputation(data, computedVariables, baseVariable,
  computedFunction = mean, groupBy = NULL, numberOfBins = NULL,
  sizeOfWindow = NULL, step = NULL, type = "sliding", ...)

Arguments

data

: dataframe or data.table containing the variables

computedVariables

: vector of character representing the name of the columns in the data

baseVariable

: character representing the name of the columns of the base variable upon which the window is sliding

computedFunction

: either a character ("mean") or a function (mean) specifying the computation you want to use. If computedFunction is a vector, the function will compute for all variables iteratively

groupBy

: optional - if set, compute grouped by variable "groupBy" and add a column named with the name of that variable to the output DT

sizeOfWindow

(optional) : numeric valuein the metric of the base variable defining the size of the sliding window

...

(optional) : the rest of the arguments are to be passed to the computedFunction when it is called (eg na.rm=T)

step(optional)

: numeric value in the metric of the base variable definig how much the windows moves at each step if the step is smaller than sizeOfWindow, overlap value will be generated

Note

DevStatus: one pass - utility 5/5 TODO(Albert): make example


albertbuchard/r-pipeline documentation built on May 5, 2019, 6:57 p.m.