Skip to content
Prev 11941 / 12125 Next

[R-pkg-devel] devtools::check() endless loop

On 2025-12-09 10:02 a.m., H?sing, Johannes via R-package-devel wrote:
Perhaps you are not building the package first, and then checking the 
built result?

If your package is named staduicc and you are working on version 1.0.0, 
there would be two steps.  The first step is

   R CMD build <path to>/staduicc

This produces staduicc_1.0.0.tar.gz .  The second step is

   R CMD check staduicc_1.0.0.tar.gz

This does the check.  The devtools::check() function does both of these 
steps.
I haven't seen that particular issue.  I think you probably just need to 
ignore it.
Writing R Extensions is the "official" documentation, written by the R 
Core group.  R-pkgs.org is a web site based on Hadley Wickham's book 
about R.  Hadley is not in R Core, but he has a lot of experience 
building packages, and works at Posit, a company that started building 
addons for R, and has now branched out.  He was the principal author of 
the devtools package.  usethis is another one of Posit's packages.  Its 
goal is to simplify the tasks that are required to work with R.

 >Speaking of this, does a usethis:: function exist which runs @examples 
in isolation from he other checks? The editor fails checking for matched 
brackets and stuff, so the example is the main debugging chore as I 
cannot seem to run examples without devtools::checking the rest.

You can check examples one at a time in an R session by running

   example( topic )

I don't know if there's an easy way to run all the examples but not run 
the rest of the checks.  I just run them all.
Generally browser() will only work in an interactive session.  So if you 
had a call to browser() in an example, it would run when you used 
example(topic), but not when you used R CMD check.>
I never use load_all(), so I can't really tell you anything specific 
about it.  My understanding is that it sort of fakes the process of 
building and installing a package.  I just build and install packages 
when I want to test them, in the belief that the time saved by 
load_all() comes with the risk that the fakery isn't perfect, and will 
waste lots of time when the real behaviour doesn't match the load_all() 
behaviour.

Duncan Murdoch