Moving average with varying time window in R

后端 未结 6 1635
时光取名叫无心
时光取名叫无心 2020-12-31 23:43

I want to compute a moving average over a certain time window without generating NAs at the beginning of the time series. For instance, if I set the time window to 3, the 2

6条回答
  •  再見小時候
    2021-01-01 00:21

    Add zero's to the beginning and ending of your sequence with the size of the moving average. This will prevent NAs.

提交回复
热议问题