apply a function to several windows of a data.frame

applyWindows(
  ds,
  FUN,
  prevRes = list(),
  winInfo = get_winInfo(nrow(ds)),
  isVerbose = TRUE,
  ...
)

Arguments

ds

data.frame to iterate

FUN

function to apply to subsets of the data.frame taking a subset of the data.frame as first argument the second: a one-row data.frame with window information (iWindow, dayStart, dayEnd, iRecStart, iRecEnd, iCentralRec) the third: most recent valid result of calls FUN. Valid is a non-NULL result.

prevRes

initial values for the list that is carried between windows

isVerbose

set to FALSE to suppress messages

...

further arguments to FUN