[R] Google's R Style Guide

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Fri Aug 28 16:59:03 CEST 2009

On Fri, Aug 28, 2009 at 3:53 PM, Duncan Murdoch<murdoch at stats.uwo.ca> wrote:
> On 8/28/2009 10:41 AM, hadley wickham wrote:
>>> Perhaps most of you have already seen this?
>>>  http://google-styleguide.googlecode.com/svn/trunk/google-r-style.html
>>> Comments/Critiques?
>> I made my own version that reflects my personal biases:
>> http://had.co.nz/stat405/resources/r-style-guide.html
> I see you repeated (or independently invented?) the bad rule about closing
> braces.  They should usually go on their own line, but not when followed by
> an else clause.

 I notice neither Google nor Hadley give examples with 'else' or 'else
if' clauses!

 Talking of closing braces, I discovered this closing brace in the
colorRamp function:

   x <- seq.int(0, 1, length.out = nrow(colors))^{

 Yes, it's on a line on its own, but why is it even there in the first place?


More information about the R-help mailing list