[R] Rcmd check Error help

Liaw, Andy andy_liaw at merck.com
Thu Jan 6 02:09:14 CET 2005


The recommended way, I believe, is to _install_ the package (say in some
test directory) and try it out.  Only when you have no problem loading the
package in R from that installation would you then try R CMD check.

When you install the package (as R CMD check does, in the directory
pkg.Rcheck), it concatenate all the files in R/ into one file, and install
it in the R/ subdirectory.  When the package is loaded, that file is
source()'ed into R.  If there are syntax errors, that's where they are
found.  So it'd be easier to diagnose such problem if you install the
package first and try to load it.

One possibility is to try and source() all the files in the R/ directory
under the source package to see which one fails.  You can do that easily
enough in one simple loop.

HTH,
Andy

> From: McGehee, Robert
> 
> R-help,
> I'm the primary developer for an increasingly large R package 
> with over
> three thousand lines of code. Unfortunately, do the complexity of the
> code, I sometimes am required to change several 
> interoperating parts of
> the package before testing for bugs and performance. And sometimes
> unnoticed syntax errors slip in that cause Rcmd check / 
> INSTALL to fail
> with such messages as:
> 
> Error in parse(file, n, text, prompt) : syntax error on line 223
> Execution halted
> 
> My question: what file should I be checking for line 223? When running
> Rcmd INSTALL, the previous version is restored on an install 
> fail, so I
> can't check the install directory, the Rcmd check directory only
> produces two log files, and my R-package has at least a dozen files to
> choose from.
> 
> Aside from brute force commenting out file by file until the syntax
> error disappears (certainly a wasteful use of time), how can 
> I find out
> where my error is?
> 
> Thank you,
> Robert
> 
> > version
>          _              
> platform i386-pc-mingw32
> arch     i386           
> os       mingw32        
> system   i386, mingw32  
> status                  
> major    2              
> minor    0.1            
> year     2004           
> month    11             
> day      15             
> language R    
>        
> Robert McGehee
> Geode Capital Management, LLC
> 53 State Street, 5th Floor | Boston, MA | 02109
> Tel: 617/392-8396    Fax:617/476-6389
> mailto:robert.mcgehee at geodecapital.com
> 
> 
> 
> This e-mail, and any attachments hereto, are intended for use by the
> addressee(s) only and may contain information that is (i) confidential
> information of Geode Capital Management, LLC and/or its affiliates,
> and/or (ii) proprietary information of Geode Capital Management, LLC
> and/or its affiliates. If you are not the intended recipient of this
> e-mail, or if you have otherwise received this e-mail in error, please
> immediately notify me by telephone (you may call collect), or 
> by e-mail,
> and please permanently delete the original, any print outs and any
> copies of the foregoing. Any dissemination, distribution or copying of
> this e-mail is strictly prohibited.
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
> 
>




More information about the R-help mailing list