On 22/10/2008, at 2:24 AM, Pedroso MOACIR wrote:

Hi all,

Why subscripting a one column matrix drops one dimension?

x<- matrix(rnorm(100), ncol=1)

str(x)
 num [1:100, 1] -0.413 -0.845 -1.625 -1.393  0.507 ...

str(x[20:30,])
 num [1:11] -0.315 -0.693 -0.771  0.448  0.204 ...

str(x[20:30])
 num [1:11] -0.315 -0.693 -0.771  0.448  0.204 ...

        Try x[20:30,1,drop=FALSE]

                cheers,

                        Rolf Turner

######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to