Re: [R] Problem with zoo and rbind() converting matrix to vector

2009-03-21 Thread Ken-JP
Hi Achim, That was a very quick reply/fix that got posted in between my reading and my response. I have downloaded your fix from: svn checkout svn://r-forge.r-project.org/svnroot/zoo for the HEAD revision and confirmed that it works as expected - I tested using the code I posted in the first m

Re: [R] Problem with zoo and rbind() converting matrix to vector

2009-03-21 Thread Ken-JP
Thank you for your reply, but I am still confused. Let me clarify... ...my problem isn't with zoo-ness per se. With zoo objects, there appears to be zoo-matrices and zoo-vectors. My problem is this - I start with a zoo-matrix: > x <- m[1,,drop=FALSE] > x inp 2003-02-01 5 > is.matr

Re: [R] Problem with zoo and rbind() converting matrix to vector

2009-03-21 Thread Achim Zeileis
On Sat, 21 Mar 2009, Ken-JP wrote: require( zoo ) inp <- c( 5, 9, 4, 2, 1 ); m <- zoo( cbind( inp ), as.Date("2003-02-01") + (0:(length(inp)-1))); dim( m ) # [1] 5 1 dim( m[1,,drop=FALSE] ) # [1] 1 1 - ok dim( lag( m, -1 )) # [1] 4 1 - ok dim( rbind( m[1,,drop=FALSE], lag(m,-1) )) # NULL - c

Re: [R] Problem with zoo and rbind() converting matrix to vector

2009-03-21 Thread David Winsemius
On Mar 21, 2009, at 2:31 PM, Ken-JP wrote: require( zoo ) inp <- c( 5, 9, 4, 2, 1 ); m <- zoo( cbind( inp ), as.Date("2003-02-01") + (0:(length(inp)-1))); dim( m ) # [1] 5 1 dim( m[1,,drop=FALSE] ) # [1] 1 1 - ok dim( lag( m, -1 )) # [1] 4 1 - ok dim( rbind( m[1,,drop=FALSE], lag(m,-1) )) # NU

[R] Problem with zoo and rbind() converting matrix to vector

2009-03-21 Thread Ken-JP
require( zoo ) inp <- c( 5, 9, 4, 2, 1 ); m <- zoo( cbind( inp ), as.Date("2003-02-01") + (0:(length(inp)-1))); dim( m ) # [1] 5 1 dim( m[1,,drop=FALSE] ) # [1] 1 1 - ok dim( lag( m, -1 )) # [1] 4 1 - ok dim( rbind( m[1,,drop=FALSE], lag(m,-1) )) # NULL - converted from zoo matrix to zoo vector