[R] How "else" works

Brian.J.GREGOR@odot.state.or.us Brian.J.GREGOR at odot.state.or.us
Tue Feb 11 23:44:12 CET 2003

I have what is likely to be a simple question about the else keyword.

The usage in the help pages is as follows:

	if(cond) cons.expr  else  alt.expr

I would expect to be able to use it in the following way as well:

	else alt.expr

This results a syntax error.

Am I doing something wrong, or doesn't R support the spanning of the
combination of if and else statements over several lines?

Brian Gregor, P.E.
Transportation Planning Analysis Unit
Oregon Department of Transportation
Brian.J.GREGOR at odot.state.or.us
(503) 986-4120

More information about the R-help mailing list