Re: [R] if else statement

From: Sebastian P. Luque <spluque_at_gmail.com>
Date: Fri 19 Jan 2007 - 03:21:14 GMT

On Thu, 18 Jan 2007 19:02:49 -0800,
"H. Paul Benton" <hpbenton@scripps.edu> wrote:

> Hello,

> I'm doing some scripting and I've noticed that R doesn't seem to
> have an
> if (cond){
> do
> }ifelse (cond) {
> do
> } else {
> do
> }

> type block.

It's legal to join if else statements together:

if (cond) {

    do X
} else if (cond) {

    do Y
} else if (cond) {

    do Z
} else do W

-- 
Seb

______________________________________________
R-help@stat.math.ethz.ch 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.
Received on Fri Jan 19 14:25:01 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 19 Jan 2007 - 04:30:27 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.