[R] If Statement with more than one condition

2010-10-22 Thread Santosh Srinivas
I'm unable to find the OR operator like other language .. any suggestions? I want to do If (condition1 OR condition 2){ do something } Thanks for answering this elementary question. [[alternative HTML version deleted]] __

Re: [R] If Statement with more than one condition

2010-10-22 Thread Joshua Wiley
Hi Santosh, I believe you are looking for |. For example: if(3 5 | 3 4) {print(TRUE)} Cheers, Josh On Fri, Oct 22, 2010 at 12:51 AM, Santosh Srinivas santosh.srini...@gmail.com wrote: I'm unable to  find the OR operator like other language .. any suggestions? I want to do If (condition1

Re: [R] If Statement with more than one condition

2010-10-22 Thread Duncan Murdoch
Joshua Wiley wrote: Hi Santosh, I believe you are looking for |. For example: if(3 5 | 3 4) {print(TRUE)} In an if () statement you use || more often. | is a vector operator that always evaluates both arguments; || is a scalar operator that quits if the left hand argument determines

Re: [R] If Statement with more than one condition

2010-10-22 Thread news
Santosh Srinivas santosh.srini...@gmail.com writes: I'm unable to find the OR operator like other language .. any suggestions? I want to do If (condition1 OR condition 2){ do something } if((condition1) | (condition2)){ do something } -- aleblanc