Hi list, I don't know if somebody has spent a lot of time debugging strange problems with if else positioning - the parser seems to recognize only the syntax bellow - this is the only way of making these pieces of code to work.
As far as i'm concerned, no examples were available (it would be so awesome to have them in the introductory manual!) #Try to change the placement of the keywords and you are dead! 4 examples Ex1: if (1==1){ print('if') print('if again') }else print('else') Ex2: if (2==2) print('if') else print('else') Ex3: if (2==2){ print('if') print('if again') }else { print('else') print('else2') } Ex4: if (2==2){ print('if') print('if again') }else print('else') cheers, ------------------------------------- Daniela ______________________________________________ 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.