Thank you for all the answers. More especifically, what I am thinking is the
following: I have a txt file with data such as


TimeStamp,Close

2007-05-31 06:00:00.523,111.15

2007-05-31 06:00:15.431,111.85

2007-05-31 06:00:16.004,112.31

2007-05-31 06:00:18.442,112.29

2007-05-31 06:00:22.222,111.85

2007-05-31 06:00:25.463,112.09

2007-05-31 06:00:25.585,112.13
what I would like is to have a container like a set (from STL c++) where the
key is the TimeStamp, and the values are the Close (or something like OLHC).
What I would like is to find an already existing c++ class that can be used
in TimeStamp, such that it "understands" what "2007-05-31 06:00:25.585" is,
and some operators like <, >, ... are already implemented. There are many
algorithms in STL which could be used to perform operations on the time
series. Then, after finishing, save the results in a text file and open the
resulting text file in R.

Any ideas of a class that could be used easily?

I will check to vectorize my calculations, but I think it is going to be
difficult or impossible.


On 7/31/07, Gabor Grothendieck <ggrothendieck@gmail.com> wrote:
>
> No, zoo does not use builtin time and date classes.  It does not
> know anything about Date, chron, POSIXct, etc.  Its completely
> general and only assumes that whatever classes you use are ordered
> (that's the O in zoo) and have certain methods defined. See ?zoo for
> more information on the methods assumed.
>
> For example, here we are using letters as our time/date class.  The
> time/date class in this example is not even numeric:
>
> > library(zoo)
> > z <- zoo(11:15, letters[1:5])
> > merge(z, lag(z, -1))
>   z lag(z, -1)
> a 11         NA
> b 12         11
> c 13         12
> d 14         13
> e 15         14
>
> (Actually there are a few exceptions to the above for convenience, i.e.
> "yearqtr" and "yearmon" classes are provided, as.Date.numeric
> is provided and read.zoo understands Date and POSIXct classes
> but overall the statement that its perfectly general is correct.)
>
>
> On 7/31/07, Jordi Molins <jordi.molins.coronado@gmail.com> wrote:
> > I usually use zoo for my time series in R. However, sometimes my
> algorithms
> > are very slow. Maybe my code is inefficient, but I need to add several
> for
> > and ifs, which I believe slows down the whole calculation.
> >
> > I have been thinking that if I could use the C++ STL for intersections
> (and
> > other operations), in addition to use the fast for and if in c++, the
> > calculation could be much faster. My problem is that I do not know any
> time
> > and date class in C++ with the same conventions as in zoo and POSIX. I
> have
> > been googling, and I have found Boost.Date_Time, which apparently does
> quite
> > a lot of what I want.
> >
> > Is zoo using some time and date class from C++? If yes, which one? if
> not,
> > which one could I use?
> >
> > Thank you.
> >
> >        [[alternative HTML version deleted]]
> >
> > _______________________________________________
> > R-SIG-Finance@stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> > -- Subscriber-posting only.
> > -- If you want to post, subscribe first.
> >
>



-- 
Pax et Lux

	[[alternative HTML version deleted]]

