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

Ken-JP kfmfe04 at gmail.com
Sat Mar 21 19:31:31 CET 2009



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!?!?
# any way to keep the last line as a zoo matrix???



-- 
View this message in context: http://www.nabble.com/Problem-with-zoo-and-rbind%28%29-converting-matrix-to-vector-tp22638959p22638959.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list