[R] Axe time of series in format yy-mm-dd

Gabor Grothendieck ggrothendieck at myway.com
Wed Dec 17 01:43:05 CET 2003



I just noticed an error in my posting below.

The origin in get.hist.quote is relative to day=30, not day=31.

--- 
Date: Sat, 6 Dec 2003 14:06:49 -0500 (EST) 
From: Gabor Grothendieck <ggrothendieck at myway.com>
To: <mendigo at netcabo.pt>, <r-help at stat.math.ethz.ch> 
Subject: RE: [R] Axe time of series in format yy-mm-dd 

 
 


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

______________________________________________
R-help at stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help




More information about the R-help mailing list