How to impute missing values in Time series by Moving Average in R



I am trying to impute the missing values in a time series by moving average method in R.

Attached the slides that I could find in the web regarding this topic.

I am new to R and have no clue where to start with. Any help would be much appreciated!


New (246.9 KB)


@krishnamreddy- Sorry I am unable to download the slides.But if you need any help regarding moving average method in R.

It is very good examples .

Hope this helps!



Sorry also unable to open the slides…

But doing this in R is really simple.

You can use this package:

Install it with: install.packages(“imputeTS”)
Load it: library(imputeTS)

And then it has a function called:, k = 4, weighting = “exponential”)

Where x would be your time series, k is the window size and with weighting you can choose between simple,linear, exponentially weighted moving average,