Skip to content
Back to formatted view

Raw Message

Message-ID: <42852C8A.1060600@o2.pl>
Date: 2005-05-13T22:39:06Z
From: Wojtek Slusarski
Subject: problem with as.timeSeries()

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