JC Vaugeois <[EMAIL PROTECTED]> writes:
> Hi,
> is there any way to keep a sub matrix dimension?
>
> exemple :
> i1<-1; i2<-1
> j1<-2; j2<-3;
> ret <-matrix(1,4,4)[i1:i2,j1:j2] ;
>
> dim(ret) is NULL because the submatrix single col or single row is coerce to a
> vector automaticaly.
> How can i bypass this cast : submatrix->vector ???????
help("[")
drop=FALSE is what you're looking for
--
O__ ---- Peter Dalgaard Blegdamsvej 3
c/ /'_ --- Dept. of Biostatistics 2200 Cph. N
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907
______________________________________________
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html