csv file:
"Date","","","","","",
"2014-01-03",1832.98,1838.24,1829.13,1831.37,0,1831.37
"2014-01-06",1831.37,1837.16,1823.73,1826.77,0,1826.77
"2014-01-07",1826.77,1840.1,1828.71,1837.88,0,1837.88
"2014-01-08",1837.88,1840.02,1831.4,1837.49,0,1837.49
Command:
> getSymbols("SPX3",src="csv")
> SPX3:
SPX3.Open SPX3.High SPX3.Low SPX3.Close SPX3.Volume
2014-07-23 1832.98 1838.24 1829.13 1831.37 0
2014-07-23 1831.37 1837.16 1823.73 1826.77 0
2014-07-23 1826.77 1840.10 1828.71 1837.88 0
2014-07-23 1837.88 1840.02 1831.40 1837.49 0
SPX3.Adjusted
2014-07-23 1831.37
2014-07-23 1826.77
2014-07-23 1837.88
2014-07-23 1837.49
So, it has loaded everything in correctly except the dates. Anyone know why? By the way, this is the same problem as this guy had (Date error while reading csv file into getSymbols) but there was no solution.
Use setSymbolLookup
to specify that SPX3
should be read from CSV and ensure the format
is correct.
require(quantmod)
setSymbolLookup(SPX3=list(src="csv",format="%Y-%m-%d"))
getSymbols("SPX3")