Skip to content
Prev 6275 / 15274 Next

!SPAM: Re: aligning xts object to regularly spaced time clock

(to.period isn't the correct function for this)

Typically, on tick data, I will use align.time to get everything on an even 
index, like seconds.  This will only align on a period where you have an 
observation, as you've noticed.

Then, to get to precisely what you want, you'd do:

#this will insert NA's on the missing time stamps
index(geTrades) <- td1sec

# then this fills it in
geTrades <- na.locf(geTrades)

Regards,

    - Brian
On 06/21/2010 07:51 PM, Eric Zivot wrote: