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]]
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.srinivas at gmail.com> wrote:> 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]] > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- Joshua Wiley Ph.D. Student, Health Psychology University of California, Los Angeles http://www.joshuawiley.com/
news at aleblanc.cotse.net
2010-Oct-22 09:46 UTC
[R] If Statement with more than one condition
"Santosh Srinivas" <santosh.srinivas at 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