The following works fine in R
myarray <- as.array(list(c(5,5), 9, c(4,2,2,4,6))) mydf <- as.data.frame(myarray)
But in Splus, this does not indicate --- an error message:
Problem in data.frameAux.list(x, na.strings = na.st..: arguments imply differing number of rows: 2, 1, 5 Use traceback() to see the call stack
Q: What is going on? How can I get this to work in Splus?
EDIT: I have to clarify why I'm going through this weird process of handling list as data.frame . This is because in the end I would like to do something like Splus:
mypos <- timeSeq("1/1/08", "1/3/08", by = "days") myts <- timeSeries(data = mydf, positions = mypos)
The best possible option right now, I think, would be to create a list like:
mytshack <- list(mypos, as.list(myarray))
But this is inconvenient, and I would like to get timeSeries functionality, if possible