[R] Axe time of series in format yy-mm-dd
Gabor Grothendieck
ggrothendieck at myway.com
Sat Dec 6 20:06:49 CET 2003
get.hist.quote produces times relative to Dec 31, 1899, so try this:
require(tseries)
require(chron)
ibm <- get.hist.quote( "ibm", start = "2003-01-01", quote = "Close" )
time.ibm <- chron( time(ibm), out.format="y-m-d",
origin = c( month = 12, day = 31, year = 1899 ) )
plot( time.ibm, ibm, type="l", simplify = F )
The simplify=F flag on plot forces the year to appear. Without
it, only the month and day are displayed.
---
Date: Sat, 6 Dec 2003 17:48:06 -0000
From: M. M. Palhoto N. Rodrigues <mendigo at netcabo.pt>
To: R Help <r-help at stat.math.ethz.ch>
Subject: [R] Axe time of series in format yy-mm-dd
I'm trying to plot a ibm stock time series.
I made the download of that series,
ibm <- get.hist.quote(instrument = "ibm", start = "2003-01-01",quote=c("CL"))
And ibm is a serie wiht this characteristic:
Start = 37623
End = 37960
Frequency = 1
When I try to plot it,
ts.plot(ibm)
In the graphic the axe time is represented by 37623 ... 37960, How can I put the time in the format,
yy-mm-dd ?
Thanks a lot
More information about the R-help
mailing list