(I am sorry if the term is not correct).
In R, I have a numeric vector x
. I want to create new vector y
where:
y[i] = mean (x[1:i)
It is easy to write a function to calculate y
, but is there a built-in function in R which do the task?
Thank you very much