Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
athammad opened this issue Jan 29, 2024 · 0 comments
Open

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

athammad opened this issue Jan 29, 2024 · 0 comments

Comments

@athammad
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant