[R] Rcmd check Error help
Martin Maechler
maechler at stat.math.ethz.ch
Thu Jan 6 11:50:10 CET 2005
>>>>> "AndyL" == Liaw, Andy <andy_liaw at merck.com>
>>>>> on Wed, 5 Jan 2005 20:09:14 -0500 writes:
AndyL> The recommended way, I believe, is to _install_ the
AndyL> package (say in some test directory) and try it out.
AndyL> Only when you have no problem loading the package in
AndyL> R from that installation would you then try R CMD
AndyL> check.
yes.
AndyL> When you install the package (as R CMD check does, in
AndyL> the directory pkg.Rcheck), it concatenate all the
AndyL> files in R/ into one file, and install it in the R/
AndyL> subdirectory. When the package is loaded, that file
AndyL> is source()'ed into R. If there are syntax errors,
AndyL> that's where they are found. So it'd be easier to
AndyL> diagnose such problem if you install the package
AndyL> first and try to load it.
yes. One thing that helps much nowadays (newer R versions) is
to make sure that you do *not* lazyload by using
R CMD INSTALL --no-lazy <pkg>
^^^^^^^^^
(or even adding 'LazyLoad: no' to the package DESCRIPTION file
during development).
Only in this case, you can easily locate the file you were
asking (in the *installed* directory) as file <pkgname>/R/<pkgname>
AndyL> One possibility is to try and source() all the files
AndyL> in the R/ directory under the source package to see
AndyL> which one fails. You can do that easily enough in
AndyL> one simple loop.
AndyL> 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
More information about the R-help
mailing list