From: Luis Torgo (ltorgo@liacc.up.pt)
Date: Fri 28 Jun 2002 - 19:18:42 EST
Message-id: <20020628091019.784D91C143@mail.liacc.up.pt>
Hi. I have a question concerning the easiest way to index a time series
object holding some stock quotes. An example:
> ibm <- get.hist.quote("IBM",start="2000-01-01")
My question is:- Suppose I want to know the stock quotes on 2000-01-03. Which
is the easiest way to index the "ibm" time series object to get them?
I got what I wanted using:
>
window(ibm,start=julian(as.POSIXct("2000-01-03")),end=julian(as.POSIXct("2000-01-03")))
But I'm sure there is a much better way to get it!
In summary, my problem is to find the easiest way to convert from my
"natural" way of thinking on the quotes (which is date-based) into the
indexing schema of time series objects, which by looking at the code of
"get.hist.quote" is based on the conversion into the number of days (using
"julian") from an origin.
Thank you for any help.
Luis
--
Luis Torgo
FEP/LIACC, University of Porto Phone : (+351) 22 607 88 30
Machine Learning Group Fax : (+351) 22 600 36 54
R. Campo Alegre, 823 email : ltorgo@liacc.up.pt
4150 PORTO - PORTUGAL WWW : http://www.liacc.up.pt/~ltorgo
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
This archive was generated by hypermail 2.1.3 : Wed 16 Oct 2002 - 11:57:34 EST