Skip to content

calculate FUN at every by-th time point rather than every point. #96

@athammad

Description

@athammad

I am trying to make Runner returning a list of windows as follows:

1 2 3 4 5
5 6 7 8 9
9 10 11 12 13

This is the behaviour of rollapply as in the following example

require(zoo)
TS <- zoo(c(1:20))
rollapply(TS, width = 5, by = 4, FUN = print, align = "left")

I thought I could get the same results using the lag argument in runner

list1<-runner(
  x=c(1:20),
  k = 5,
  lag=4,
  simplify = F
)

list2<-runner(
  x=c(1:20),
  k = 5,
  lag=-4,
  simplify = F
)

What am I missing or is this feature not available?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions