[R-SIG-Finance] how to read in this time series csv file with both dates and times?

Michael comtech.usa at gmail.com
Sun Jun 21 08:42:11 CEST 2009


Hi all,

I want to read in this "csv" file,

3/1/2009 23:00:00,123.76,123.94,123.7
3/2/2009 0:00:00,123.85,124.16,123.85
3/2/2009 1:00:00,124.11,124.15,124.06
3/2/2009 2:00:00,124.14,124.32,124.12
3/2/2009 3:00:00,124.2,124.21,124.11
3/2/2009 4:00:00,124.16,124.18,123.94
3/2/2009 5:00:00,124.01,124.2,123.97

And I got the following error message, what could be wrong?

Thanks a lot!


z <- read.zoo("prices.csv", header = TRUE, sep = ",", FUN =
as.chron(format=c(dates = "m/d/y", times = "h:m:s")))
Error in inherits(x, "chron") : element 1 is empty;
   the part of the args list of '.Internal' being evaluated was:
   (x, what, which)



More information about the R-SIG-Finance mailing list