if(cond) expr if(cond) cons.expr else alt.expr
Also see ?ifelse John Kane Kingston ON Canada > -----Original Message----- > From: bunnylove...@optonline.net > Sent: Mon, 30 Jul 2012 05:55:34 -0700 (PDT) > To: r-help@r-project.org > Subject: [R] If/then statement, if in a list then > > I need to write an if/then statement saying something along the lines of: > if (VALUE is in list) {... > How do I write that in R's language. > Thanks! > > > > -- > View this message in context: > http://r.789695.n4.nabble.com/If-then-statement-if-in-a-list-then-tp4638346.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help@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. ____________________________________________________________ FREE 3D EARTH SCREENSAVER - Watch the Earth right on your desktop! ______________________________________________ R-help@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.