On Mon, 26 Jan 2004 20:15:51 +0100, <uaca at alumni.uv.es> wrote:
I want to conditionally operate on certain elements of a matrix, let me
explain it with a simple vector example
z<- c(1, 2, 3)
zz <- c(0,0,0)
null <- (z > 2) & ( zz <- z)
zz
[1] 1 2 3
why zz is not (0, 0, 3) ?????
in the other hand, it curious that null has reasonable values
What you have done there is create a boolean vector, null, of the same
length as z (and zz).
For instance:
(z > 2) & (zz <- z)
=(F F T) & (T T T) (as assignment - presumably - returns T)