Jun Sheng Tan <thyreus56344612 at hotmail.com> [2011-09-14 02:28]:
I'm a newbie and currently facing the same issue as this guy http://pastebin.com/4bfURwBY Where the getSymbols is unable to detect the date on my excel .csv file , instead it listed (real-time) today's date as the date valueThe csv file I'm using is from yahoo http://chart.yahoo.com/table.csv?s=SBUX&a=0&b=01&c=2007&d=8&e=13&f=2011&g=d&q=q&y=0&z=SBUX&x=.csv
Original file :
Open High Low Close Volume Adj.Close2011-09-12 36.69 37.88 36.69 37.65 8122500 37.652011-09-09 38.62 38.75 37.05 37.31 10514600 37.312011-09-08 38.98 39.39 38.69 38.92 7886900 38.922011-09-07 38.19 39.37 37.96 39.18 8398900 39.182011-09-06 36.52 37.84 36.42 37.75 6135000 37.75
Does anyone know have to have the date column to list the correct date from the csv file?
~$ R
R version 2.13.0 (2011-04-13)
Copyright (C) 2011 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: x86_64-pc-linux-gnu (64-bit)
[...]
[Previously saved workspace restored]
library(quantmod)
Loading required package: Defaults
Loading required package: xts
Loading required package: zoo
Attaching package: 'zoo'
The following object(s) are masked from 'package:base':
as.Date
Loading required package: TTR
As you can see from the above, there's no need for a CSV file, but if
you want to read the data from a local CSV file that looks like::
~$ less subx.csv
Date,Open,High,Low,Close,Volume,Adj Close
2011-09-13,37.71,38.31,37.67,38.19,6159400,38.19
2011-09-12,36.69,37.88,36.69,37.65,8122500,37.65
2011-09-09,38.62,38.75,37.05,37.31,10514600,37.31
[...]
Then, in R do: