[R-SIG-Finance] Trouble with getSymbols.csv
Worik Stanton
worik.stanton at gmail.com
Mon Sep 17 23:12:27 CEST 2012
Friends
I have a file of data:
"Date","Open","High","Low","Close","Volume","Adjusted"
"2011-12-28",1.5968,1.5987,1.5762,1.5827,0,1.58745
"2011-12-29",1.5831,1.5846,1.5695,1.5724,0,1.57705
"2011-12-30",1.5726,1.5877,1.5704,1.5861,0,1.57905
"2011-12-31",1.585,1.5861,1.585,1.5861,0,1.58555
"2012-01-01",1.585,1.5861,1.582,1.5861,0,1.58405
"2012-01-02",1.5871,1.5875,1.5768,1.5802,0,1.58215
"2012-01-03",1.58,1.5837,1.5726,1.5818,0,1.57815
"2012-01-04",1.5819,1.5865,1.5796,1.5813,0,1.58305
"2012-01-05",1.5812,1.5854,1.573,1.5795,0,1.5792
"2012-01-06",1.5796,1.5871,1.5745,1.5859,0,1.5808
"2012-01-07",1.5854,1.5854,1.5782,1.5782,0,1.5818
"2012-01-08",1.5808,1.5866,1.5808,1.5866,0,1.5837
"2012-01-09",1.5867,1.591,1.5807,1.5815,0,1.58585
When I use getSymbols(.., src="csv")
The dates are incorrect. The first date is "2012-09-18"
It seems that in getSymbols.csv uses:
as.Date(fr[, 1], format = format, ..., origin = "1970-01-01")
Looking more closely...
> as.Date("2011-12-28", origin="1970-01-01", format="")
[1] "2012-09-18"
That is what I see.
But either of...
> as.Date("2011-12-28", origin="1970-01-01")
[1] "2011-12-28"
> as.Date("2011-12-28")
[1] "2011-12-28"
>
give me what I expect.
What am I doing wrong?
cheers
Worik
--
it does not matter I think that I shall never see
how much I dig and dig A billboard lovely as a tree
this hole just Indeed, unless the billboards fall
keeps getting deeper I'll never see a tree at all
More information about the R-SIG-Finance
mailing list