[R] conditional assignment

2004-01-26 Thread uaca
Hi all 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) ? the null - assignment is to keep the console silent in the other hand,

Re: [R] conditional assignment

2004-01-26 Thread Roger Bivand
On Mon, 26 Jan 2004 [EMAIL PROTECTED] wrote: Hi all 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) ? Break it

RE: [R] conditional assignment

2004-01-26 Thread Liaw, Andy
From: Simon Cullen On Mon, 26 Jan 2004 20:15:51 +0100, [EMAIL PROTECTED] 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

Re: [R] conditional assignment

2004-01-26 Thread Prof Brian Ripley
On Mon, 26 Jan 2004, Simon Cullen wrote: On Mon, 26 Jan 2004 20:15:51 +0100, [EMAIL PROTECTED] 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