S+2000 under NT4.0
I wonder how potentially dangerous the following behaviour is.
-----------------
S+>zz1_matrix(seq(12),nc=3)
S+>zz1[cbind(1:3,4:6)]_NA
S+>zz1
[,1] [,2] [,3]
[1,] 1 5 9
[2,] 2 6 10
[3,] 3 7 11
[4,] 4 8 12
S+>sum(is.na(zz1))
[1] 11
S+>length(zz1)
[1] 23
S+>as.vector(zz1)
[1] 1 2 3 4 5 6 7 8 9 10 11 12 NA NA NA NA NA NA NA NA NA NA NA
By the way
S+>zz1[1,4]_NA
Error in zz1[1, 4] <- NA: Array subscript (4) out of bounds, should be at
most 3
S+>zz1[cbind(1,4)]_NA
S+>
---------------
The problem is apparently with the internal function cbind. Any comment?
L. Molinari
----------------------
Dr. Luciano Molinari
Abt. EEG und AWE
Kinderspital Zürich
Steinwiesstr.75
CH-8032 Zürich
luciano.molinari@kispi.unizh.ch
Tel. (00411) 266 79 25
Fax (00411) 266 71 71
Men fight and lose the battle, and the thing that they fought for comes
about in spite of their defeat, and then it turns out not to be what they
meant, and other men have to fight for what they meant under another name.
(William Morris)
|