R-alpha: R-0.50-a3: [logical, drop = FALSE] -- bug in R (and S-plus)

Martin Maechler Martin Maechler <maechler@stat.math.ethz.ch>
Wed, 20 Aug 1997 19:06:11 +0200


This is a bug both in R and S-plus (in R it's "worse"), I think.
Look at this :

ma <- cbind(1,1:8); logi <- rep(c(T,F),4)
ma[logi,]
##>      [,1] [,2]
##> [1,]    1    1
##> [2,]    1    3
##> [3,]    1    5
##> [4,]    1    7

##-- now the same with  [ , drop = FALSE]

## R (-0.50-a3) :

	 ma[logi, drop = F]
##>> Error: invalid subscript type


## Splus-3.4:
	 ma[logi, drop = F]
##>> [1] 1 1 1 1 1 3 5 7

##---- which is not correct either, we would want the matrix !
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-