na.locf() will handle the second part of your question. I've not been super
successful with the maxlag optional argument, however, so do be wary if you
use that one.

Michael

On Sun, Aug 28, 2011 at 9:42 PM, Worik Stanton <worik.stanton@gmail.com>wrote:

> 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
>
> --
> The hippies were right
>
> ______________________________**_________________
> R-SIG-Finance@r-project.org mailing list
> https://stat.ethz.ch/mailman/**listinfo/r-sig-finance<https://stat.ethz.ch/mailman/listinfo/r-sig-finance>
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions
> should go.
>

	[[alternative HTML version deleted]]

