I would like to smooth out the time series to avoid false jitter / error. In other words, I want to make very local reliable anti-aliasing.
I met roulette and roulette in a zoo pack, but ran into a problem because my vector had NA. I then read somewhere that these functions of the zoo are used during work, and this is the problem.
== Examples ==
median(c(1,1,1,2,2,2,7,NA,1,2,3,10,10,10),na.rm = TRUE) runmed(c(1,1,1,2,2,2,7,NA,1,2,3,10,10,10),k=3)
The first line returns 2, but will return NA if na.rm = TRUE not included. The second line returns Error in runmed(c(1, 1, 1, 2, 2, 2, 7, NA, 1, 2, 3, 10, 10, 10), k = 3) : NA/NaN/Inf in foreign function call (arg 1) . Cannot add na.rm argument to string.
How can I get runed to handle NA? . By the way, rollmean returns a vector that is valid before NA, and then returns NA for each value after that.