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

Ben Bolker bbo|ker @end|ng |rom gm@||@com
Tue Jul 2 11:49:32 CEST 2019


  It's a pain in the neck, but even more basic than inserting browser()
calls all over the place (but possibly useful in this situation) would
be inserting appropriate cat() statements all over the place ... (and
maybe using cat() with proc.time() to report on elapsed time as you go?)

  (As for why the speed depends on the environment, I have no idea ...)

On 2019-07-02 5:31 a.m., Rolf Turner 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"?
> 
> cheers,
> 
> Rolf
>



More information about the R-package-devel mailing list