Try this code which does not use rollapply:
w <- 3
Mean <- function(L) Reduce("+", L) / length(L)
lapply(w:length(Data), function(i) Mean(Data[seq(to = i, length = w)]))
On Sun, May 14, 2017 at 6:44 PM, Christofer Bogaso
wrote:
> Hi again,
>
> I am looking to find a
Hi again,
I am looking to find a way on how to calculate Rolling average for the
elements of a list. For example consider below object 'Data'. This is
a list, where each elements are a Matrix. Basically, I am trying to
get Rolling average of those Matrices with rolling window as 5.
Data =
2 matches
Mail list logo