Skip to content
Prev 43236 / 398513 Next

conditional assignment

On Mon, 26 Jan 2004 uaca at alumni.uv.es wrote:

            
Break it down into bits:
[1] FALSE FALSE  TRUE
[1] 1 2 3
[1] FALSE FALSE  TRUE
[1] TRUE TRUE TRUE
[1] TRUE TRUE TRUE TRUE
Warning message: 
longer object length
        is not a multiple of shorter object length in: rep(TRUE, 4) & (zz <- z) 

The first part is a logical vector, the second is the result of assigning 
z to zz, & of them isn't terribly meaningful?

Try:
[1] 0 0 3

if that's what you want.