For a data frame that looks like:
Value Id
1 xxx-rrr-ttt
78 ggg-oop-rty
97 fad-dar-oki
.. ..
.. ..
.. ..
I need to calculate the rolling-mean at each row. So for a data frame s
, rolling mean at each row will be represented as s.mean
. Is there any inbuilt function in R
that can calculate rolling-mean
? I tried the following:
rollapply(data)
but it throws an error argument "width" is missing, with no default
. I could not understand this error and what is meant by the width