#Prerequisite: Load Time series with missing values
x <- tsAirgap
#Example 1: Perform imputation with simple moving average
na.ma(x, weighting = "simple")
#Example 2: Perform imputation with exponential weighted moving average
na.ma(x)
#Example 3: Perform imputation with exponential weighted moving average, window size 6
na.ma(x, k=6)
Run the code above in your browser using DataLab