[R] problem with as.timeSeries()

Wojtek Slusarski slusek at o2.pl
Sat May 14 00:39:06 CEST 2005


The matrix I want to convert to timeSeries object looks:

                       rp
2003-06-30 -1.0995685137
2003-07-01 -0.7065834677
2003-07-02  0.7661757181
  and so on...

In help it is stated that I should use as.timeSeries function like:

as.timeSeries(x, dimnames = TRUE, format = "")

So I try:
 > ts.rp = as.timeSeries(rp, dimnames=TRUE, format="%Y-%m-%d")
Error in "colnames<-"(`*tmp*`, value = character(0)) :
         attempt to set colnames on object with less than two dimensions

I don't exactly understand the error as:

 > dim(rp)
[1] 249   1

What am I doing wrong?

Best regards,
Wojtek




More information about the R-help mailing list