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
Add zero's to the beginning and ending of your sequence with the size of the moving average. This will prevent NAs.