Skip to content
Prev 131803 / 398503 Next

Odp: If Else Function

Hi

r-help-bounces at r-project.org napsal dne 11.12.2007 13:06:14:
Except the first letter, nothing sooms to be wrong.
[1] "a"
[1] "b"
[1] "c"
I beleive you noticed a difference between if() and ifelse() functions. 
And of course if you spread your command in several rows be carefull not 
to have valid syntax before you ended a whole command.
e.g.
if (1==2) {print("a")} 
else { if(1==2) {print("b")} else{print("c")} }

Error: unexpected 'else' in "else"


Regards
Petr
http://www.R-project.org/posting-guide.html