[R] unexpected results

Niels Waller niels.waller at vanderbilt.edu
Wed Jun 19 22:26:11 CEST 2002



Is R behaving correctly in this example? I do not understand why column 2
has any 2s in it (and why column 3 has any 1s)


> x<-matrix(0,10,3)
> x[seq(1,10,by=2),2:3]<-c(1,2)
> x
      [,1] [,2] [,3]
 [1,]    0    1    2
 [2,]    0    0    0
 [3,]    0    2    1
 [4,]    0    0    0
 [5,]    0    1    2
 [6,]    0    0    0
 [7,]    0    2    1
 [8,]    0    0    0
 [9,]    0    1    2
[10,]    0    0    0

Thank you for any and all help.

(I am using 1.5.0 on Windows NT)

Niels Waller

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list