[R] Google's R Style Guide

Duncan Murdoch murdoch at stats.uwo.ca
Sun Aug 30 01:16:59 CEST 2009


On 29/08/2009 6:05 PM, John Sorkin wrote:
> For my money, and perspective as one who has written a compiler, this reflects a failing of the R parser. Both
> 
> if (TRUE) {
>      cat("TRUE!!\n")
> }
> else
> {
>      cat("FALSE!!\n")
> }
> 
> and
> 
> 
> if (TRUE) 
>   {
>      cat("TRUE!!\n")
>   }
> else
>   {
>      cat("FALSE!!\n")
>   }
> 
> are easy to read, and should be accepted as a valid if . . . . else statement.

And if you enter

if (FALSE) {
      cat("TRUE!!\n")
}

at the console, how long should it wait before it decides the else isn't 
coming?

Duncan Murdoch




More information about the R-help mailing list