1

Im uploading files to R using the quantmod function getSymbols.csv. however, once i have uploaded the files, the dates seem to get lost and all the dates are the same.

I use the following code to upload the 100 stock symbols:

getSymbols.csv(symbols, env=parent.frame(), dir="E:/data/CData_Files_NB/", 
           return.class = "xts", extension="csv")

the do all get uploaded, but for each stock symbol, the dates for the entire history are the same??

  [1] "SHFJ"    "FSRJ"    "RDFJ"    "GRTJ"    "MTNJ"    "SLMJ"    "SBKJ"    "WHLJ" 
  [9] "NTCJ"    "LHCJ"    "MRFJ"    "SACJ"    "PPCJ"    "SGLJ"    "MMIJ"    "IMPJ"   
  [17] "TRUJ"    "GFIJ"    "SOLJ"    "TSHJ"    "KAPJ"    "VODJ"    "NPKJ"    "TKGJ"   
  [25] "HARJ"    "RMIJ"    "SHPJ"    "MDCJ"    "ZEDJ"    "SAPJ"    "DSYJ"    "NPNJN"  
  [33] "RMHJ"    "MURJ"    "BGAJ"    "ANGJ"    "GNDJ"    "TFGJ"    "AEGJ"    "BATJ"   
  [41] "EMIJ"    "APNJ"    "EQSJ"    "NHMJ"    "ATTJ"    "REMJ"    "FPTJ"    "STXDIVJ"
  [49] "CMLJ"    "CVHJ"    "PIKJ"    "MPCJ"    "AVIJ"    "BLUJ"    "CLSJ"    "IPLJ"   
  [57] "BVTJ"    "INLJ"    "RESJ"    "VKEJ"    "NEDJ"    "GPLJ"    "STX40J"  "HYPJ"   
  [65] "TBSJ"    "EXXJ"    "BAWJ"    "PGRJ"    "AWAJ"    "KIOJ"    "SPPJ"    "PNCJ"   
  [73] "ARIJ"    "LEWJ"    "DLTJ"    "ACLJ"    "PGLJ"    "AIPJ"    "RLOJ"    "MNDJ"   
  [81] "REBJ"    "LBHJ"    "GRFJ"    "NGPLTJ"  "GLDJ"    "CLRJ"    "DTCJ"    "ADHJ"   
  [89] "SPGJ"    "HLMJ"    "TORJ"    "MSMJ"    "DBXWDJ"  "INGJ"    "MIXJ"    "FGLJ"   
  [97] "APFJ"    "ILVJ"    "DBXUSJ"  "WEZJ"   

here is an example of what i mean. the dates all get loaded as the same (last) date?

> head(SHFJ)
              SHFJ.Open SHFJ.High SHFJ.Low SHFJ.Close SHFJ.Volume SHFJ.Adjusted
2015-07-07      5.62      5.62     5.58       5.58       719.1          5.58
2015-07-07      5.53      5.71     5.53       5.71      1021.6          5.71
2015-07-07      5.71      5.80     5.71       5.80       381.4          5.80
2015-07-07      5.80      5.80     5.75       5.75        52.8          5.75
2015-07-07      5.75      5.75     5.62       5.64        33.5          5.64
2015-07-07      5.67      5.75     5.67       5.75       189.2          5.75

what am i getting wrong? could it be something with formatting in the CSV file or is it something to do with the time series xts or zoo classes? Any help would be much apreciated.

NMRQL
  • 65
  • 1
  • 6
  • http://stackoverflow.com/questions/8970823/how-to-load-csv-data-file-into-r-for-use-with-quantmod – user227710 Jul 07 '15 at 12:49
  • im not quite sure how to apply the suggestions there to what I am doing. I can see the similarity but the difference is that I need to upload 100 symbols. I have furthermore also checked that the format of the csv file is correct by uploading this via: FormatCheck="SHFJ.csv" Stock<-data.frame Stock<-read.zoo(FormatCheck,sep=",",header=TRUE, format="%Y-%m-%d") and this seems to sort out the date issue, but id like to do this via getSymbols. – NMRQL Jul 07 '15 at 13:13

1 Answers1

0

This is a bug that has been fixed. Pull the latest from the 'develop' branch on GitHub.

Joshua Ulrich
  • 173,410
  • 32
  • 338
  • 418