[R-pkg-devel] "Progress reports" for examples in packages.

Rolf Turner r@turner @end|ng |rom @uck|@nd@@c@nz
Tue Jul 2 12:07:50 CEST 2019

On 2/07/19 9:45 PM, Iñaki Ucar wrote:

> Which line of code is it?

Dunno that it's very enlightening, without having access to the package, 
but the two lines involved are:

> fit <- ldFit(inLogs,predictor="logDose",link="logit")
> x3  <- cvCompare(fit,nrep=5)

The first line runs instantaneously from the command line, but takes a 
very long time under R CMD check.

The second causes R CMD check to disappear into a black hole, but runs 
in 5 seconds or less from the command line.

I'm sorry that I can't make the package public at this time.  It 
contains a number of data sets that my consulting client does not want 
released publicly.

I guess I could create a slightly cut down version of the package with 
the proprietary data sets removed ....  If anyone is actually interested.



P. S.  The package is about "lethal dose" estimation.  The ldFit() is 
for fitting models from which to estimate lethal doses.  The cvCompare() 
function is for using cross validation of log likelihood to assess 
goodness of fit and to compare models for goodness of fit.

The "nrep=5" is an unrealistically small value (small so as to reduce 
the amount of time needed for checking).  The default value is nrep=100.


> Iñaki
> On Tue, 2 Jul 2019 at 11:32, Rolf Turner <r.turner using auckland.ac.nz> wrote:
>> Many thanks to Henrik Bengtsson and Martin Maechler for pointing out
>> that I can monitor progress by looking at the file
>>       "mypkg.Rcheck/mypkg-Ex.Rout"
>> e.g. by using "tail -f".  This strategy indeed revealed where the hangup
>> was happening.  I wrapped a line of the examples in \dontrun{} and
>> checked the package again.  Now the checking completes in finite time! :-)
>> However I remain puzzled as to *why* the line in question induces a
>> hangup.  When I load the package and run that same  line from the
>> command line, a result is returned within about 5 seconds of "wall time"
>> (or less).
>> Another strangeness:  The line prior to that which I wrapped in
>> \dontrun{} took a very long time to return a result, although the
>> command did eventually complete (after which everything ran swiftly).
>> But when I run this same line from the command line it completes
>> *instantaneously*.
>> Why on earth would commands be slow, or not execute at all, when run
>> under the aegis of "R CMD check", but execute swiftly from the command line?
>> I think it would be unwise of me to ignore the fact that something
>> strange is going on here, but I'm damned if I can see how to go about
>> tracking the strangeness down so as to be able to remedy it.
>> My usual practice when trying to get a handle on something that I don't
>> understand is to insert browsers() into the code at strategic points.
>> See fortunes::fortune(158).  That's of no help in the current context in
>> which the problem only arises when R CMD check is being run.
>> Can anyone suggest a clever means by which I might determine the
>> "magnitude and direction of my stupidity"?

More information about the R-package-devel mailing list