data(cor.data)
d <- cor.data[[1]][,2]
plot(d, type="l")
lines(impute.loess(d, s=0.3, smooth=TRUE), lwd=2, col="red")
# add some NA's
d <- d[1:100]
d[sample(30:70, 5)] <- NA
d
impute.loess(d, s=0.2)
Run the code above in your browser using DataLab