Skip to content

Moving averages etcetera over time periods on ragged data

2 messages · Worik Stanton, R. Michael Weylandt

#
Forgive me if this has been asked/answered.

I have some data that has values only when data changes.  I would like 
to be able to use a moving average (or similar) from TTR but specify the 
time period not the number of steps.

Is there a way to do this without rebuilding my data to be regular?

Off topic, but if I have to rebuild my data is there a function like 
na.approx that I can use to make all NAs take on the preceding non-NA value?

cheers
Worik