Skip to content
Prev 45800 / 63421 Next

Patch proposal for R style consistency (concerning deparse.c)

On 05/02/2013 05:26 AM, Terry Therneau wrote:
No, it's also needed wherever the if statement is at the top-level
(i.e. not nested within { ... }), in a package:

   hpages at thinkpad:~$ R CMD INSTALL SomePackage
   * installing to library 
?/home/hpages/R/R-3.0.0--disable-byte-compiled-packages/library?
   * installing *source* package ?SomePackage? ...
   ** R
   Error in parse(outFile) :
 
/home/hpages/svn/bioconductor/Rpacks/SomePackage/R/assignReads.R:8:1: 
unexpected 'else'
   7: }
   8: else
     ^
   ERROR: unable to collate and parse R files for package ?SomePackage?
   * removing 
?/home/hpages/R/R-3.0.0--disable-byte-compiled-packages/library/SomePackage?

or in a stand-alone script:

   > source("somescript.R")
   Error in source("somescript.R") : somescript.R:4:1: unexpected 'else'
   3: }
   4: else
   ^

It's invalid code. Period.

H.