[R-SIG-Finance] Non unique timestamp in zoo object
ggrothendieck at gmail.com
Tue Sep 1 19:22:31 CEST 2009
Note that for any calculation that involves merge.zoo (which
is most calculations since even z1 + z2 can do a
merge underneath) one does require unique times in zoo.
read.zoo can read in times that are not unique but ultimately
you will want to make them unique for most operations.
The aggregate= argument of read.zoo provides a way to
collapse duplicates and there are additional facilities in the
devel version of zoo.
As indicated in my prior post in this thread zoo FAQ #1
has further discussion.
On Tue, Sep 1, 2009 at 1:13 PM, Brian G. Peterson<brian at braverock.com> wrote:
> jatin patni wrote:
>> I'm trying to create a zoo object from a tick data file(sample below)
>> contains timestamps only.
>> Filename: "20080202.trd"
>> As you can see that timestamps are not unique even at microsecond levels.
>> Inorder to create a zoo/xts object to be used with quantmod later, How do
>> 1)Do I have to merge two rows with the same timestamp, symbols, price but
>> different volumes.(Do I need to do this or is there some other way
>> 2)Append date to the timestamp while creating the zoo/xts object
>> I'm trying to explore the 'format' argument, and POSIX and chron but
>> much success.
> Your target should be POSIXct, as that is what xts uses internally, given
> that your stated goal is to use xts and quantmod.
> These look like one second bars, not microsecond bars. To see microseconds,
> if you have them:
> zoo doesn't require unique timestamps, just ordered ones. In this case,
> your trades are ordered in the files. You might need to append an order in
> the microseconds if you really only have second bars. It's also not
> necessary to have unique timestamps, but you'll be happier if you do.
> - Brian
> Brian G. Peterson
> Ph: 773-459-4973
> IM: bgpbraverock
> R-SIG-Finance at stat.math.ethz.ch mailing list
> -- Subscriber-posting only.
> -- If you want to post, subscribe first.
More information about the R-SIG-Finance