R 1.7.1 on Windows XP

The argument 'drop' appears to be ignored when subscripting
1-dimensional arrays (i.e., arrays whose 'dim' attribute has 
length 1):

> x <- array(1:5, dim=c(5))
> dim(x)
[1] 5
> dim(x[, drop=TRUE])   # Shouldn't this be NULL?
[1] 5
> dim(x[2:3])  # This seems right:  default is drop=TRUE
NULL
> dim(x[2:3, drop=FALSE])  # But this seems wrong
NULL

Note that the behavior with a 2-D array is different:

> y <- array(1:5, dim=c(1,5))
> dim(y)
[1] 1 5
> dim(y[,,drop=TRUE])
NULL
> dim(y[,2:3])
NULL
> dim(y[,2:3,drop=FALSE])
[1] 1 2

Rich Raubertas
Biometrics Research, RY33-300
Merck & Co.

------------------------------------------------------------------------------
Notice:  This e-mail message, together with any attachments,...{{dropped}}

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-devel

Reply via email to