[R-SIG-Finance] [R-sig-finance] How to read minutes data from csv files with getSymbol in quantmod?

Wind2 windspeedo at qq.com
Tue Nov 25 03:14:58 CET 2008


The read.zoo method is just as simple and useful as getSymbols.   It's what I
need.
Thanks Gabor. Thanks Simon.

Regards,
Wind


Gabor Grothendieck wrote:
> 
> A workaround would be to use read.zoo directly.  Try this:
> 
> z <- read.zoo("/tmp2/testeuro.csv", header = TRUE, sep = ",", tz = "")
> 
> If you use POSIXct you may wish to set your session to "GMT" to avoid time
> zone problems.
> 
> Sys.setenv(TZ = "GMT")
> 
> or use chron which has no time zones in the first place:
> 
> library(chron)
> z <- read.zoo("/tmp2/testeuro.csv", header = TRUE, sep = ",", FUN =
> as.chron)
> 
> 
> 2008/11/24 Wind <windspeedo at qq.com>:
>> The following code could read the csv file but the time is trimmed to
>> Dates.
>> Any way we could read minutes data from csv as easy as getSymbols?
>> Thanks.
>>
>> Codes:
>> require(quantmod)
>> getSymbols('EURO1',src="csv",dir="d:/datacenter/dataexchange")
>>
>> Output:
>>> EURO1[1:5]
>>           EURO1.Open EURO1.High EURO1.Low EURO1.Close EURO1.Volume
>> EURO1.Adjusted
>> 2008-11-11    1.25490    1.25495   1.25410     1.25440            0             
>> 0
>> 2008-11-11    1.25525    1.25555   1.25490     1.25490            0             
>> 0
>> 2008-11-11    1.25665    1.25665   1.25525     1.25525            0             
>> 0
>> 2008-11-11    1.25725    1.25725   1.25655     1.25665            0             
>> 0
>> 2008-11-11    1.25735    1.25775   1.25715     1.25725            0             
>> 0
>> Warning message:
>> In zoo(rval, x.index[i]) :
>>  some methods for "zoo" objects do not work if the index entries in
>> 'order.by' are not unique
>>>
>>
>> Contents of d:/datacenter/dataexchange/EURO1.csv
>>
>> "","Open","High","Low","Close","Volum","Adjusted"
>> "2008/11/14 22:57:00",1.272625,1.27345,1.27225,1.272775,0,0
>> "2008/11/14 22:56:00",1.2709,1.27265,1.27075,1.27265,0,0
>> "2008/11/14 22:55:00",1.268925,1.27115,1.268925,1.27085,0,0
>> "2008/11/14 22:54:00",1.269275,1.269375,1.268725,1.268925,0,0
>> "2008/11/14 22:53:00",1.26975,1.269775,1.26915,1.26925,0,0
>> "2008/11/14 22:52:00",1.27005,1.27035,1.26955,1.269725,0,0
>> "2008/11/14 22:51:00",1.27055,1.27055,1.26975,1.270025,0,0
>> "2008/11/14 22:50:00",1.2704,1.27075,1.270225,1.27055,0,0
>> "2008/11/14 22:49:00",1.26995,1.27055,1.26965,1.270375,0,0
>> "2008/11/14 22:48:00",1.26955,1.26995,1.26885,1.269925,0,0
>> _______________________________________________
>> R-SIG-Finance at stat.math.ethz.ch mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>> -- Subscriber-posting only.
>> -- If you want to post, subscribe first.
> 
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only.
> -- If you want to post, subscribe first.
> 
> 

-- 
View this message in context: http://www.nabble.com/How-to-read-minutes-data-from-csv-files-with-getSymbol-in-quantmod--tp20663909p20673998.html
Sent from the Rmetrics mailing list archive at Nabble.com.



More information about the R-SIG-Finance mailing list