#input data
inputArray<-c(1,2,3,4,NA,1,2,3,4,5)
#array lag 3
out_movavg<-MOVAVG(inputArray,3)
print(out_movavg)
#ts lag 4 centered with missings
ts1<-TSERIES(inputArray,START=c(2000,1),FREQ='A')
out_movavg<-MAVE(ts1,4,'CENTER')
TABIT(out_movavg)
#ts daily
ts1<-TSERIES(inputArray,START=c(2000,1),FREQ='D')
out_movavg<-MAVE(ts1,3)
TABIT(ts1,out_movavg)
Run the code above in your browser using DataLab