On 15-Feb-10 09:13, jim holtman wrote:
This is a common question. The problem is basically when input commands at the command line, when you hit the carriage return it is assuming there is a complete command. Within a function, or a block like the 'for' loop, the statement is not complete until the closing bracket, so internally it will be parsed correctly, but just get into the habit of making sure the if/else are on the same line or bracket.
Ah .. so the fact that this is inside a block (in this case a function) makes a difference .. I see .. well this is certainly different from other languages I have worked with, but the explanation is clear. Thanks you! Esmail ______________________________________________ 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.