R-alpha: another minor problem

Kurt Hornik Kurt.Hornik@ci.tuwien.ac.at
Wed, 13 Aug 1997 09:28:08 +0200


As it seems that everyone's wishes for getting bugs fixed are granted
right away, here is something that I alread mentioned once.

* It seems that S allows recycling when subscripting with logicals, but
R does not.  E.g.,

        R> x <- 1:5
        R> x
        [1] 1 2 3 4 5
        R> i <- c(F, T)
        R> x[i]
        Error: invalid subscript type
        R>

In S, this is treated as x[rep(i, length = length(x))].

* It also seems that S does not worry about excluding subscripts which
are out of bounds.  In the above, x[-6] would give x, but in R

        R> x[-6]
        Error: subscript out of bounds


-k
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
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
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-