Install the source package, figure out the reverse dependencies on CRAN,
download all of their source packages, and run
R CMD check on them
1 2 3 4
The package name.
Which types of reverse dependencies to check. See
Whether to only check the failed packages from last time. By
default, if there are any ‘*.Rcheck’ directories,
A vector of package names to be ignored in
Whether to update all packages before the check.
The path of the source package directory.
The parent directory of the source package directory. This can be set in a global option if all your source packages are under a common parent directory.
The output Markdown file to which the diffs in check logs will be written. If the markdown package is available, the Markdown file will be converted to HTML, so you can see the diffs more clearly.
Everything occurs under the current working directory, and you are recommended to call this function under a designated directory, especially when the number of reverse dependencies is large, because all source packages will be downloaded to this directory, and all ‘*.Rcheck’ directories will be generated under this directory, too.
If a source tarball of the expected version has been downloaded before (under the ‘tarball’ directory), it will not be downloaded again (to save time and bandwidth).
After a package has been checked, the associated ‘*.Rcheck’ directory will be deleted if the check was successful (no warnings or errors or notes), which means if you see a ‘*.Rcheck’ directory, it means the check failed, and you need to take a look at the log files under that directory.
The time to finish the check is recorded for each package. As the check goes
on, the total remaing time will be roughly estimated via
n is the number of packages remaining to be
times is a vector of elapsed time of packages that have
If a check on a reverse dependency failed, its ‘*.Rcheck’ directory will
be renamed to ‘*.Rcheck2’, and another check will be run against the
CRAN version of the package. If the logs of the two checks are the same, it
means no new problems were introduced in the package, and you can probably
ignore this particular reverse dependency. The function
compare_Rcheck() can be used to create a summary of all the
differences in the check logs under ‘*.Rcheck’ and ‘*.Rcheck2’.
This will be done automatically if
TRUE) has been set.
A recommended workflow is to use a special directory to run
rev_check(), set the global
repos in the R startup (see
?Startup) profile file
.Rprofile under this directory,
and (optionally) set
R_LIBS_USER in ‘.Renviron’ to use a special
library path (so that your usual library will not be cluttered). Then run
xfun::rev_check(pkg) once, investigate and fix the problems or (if you
believe it was not your fault) ignore broken packages in the file
‘00ignore’, and run
xfun::rev_check(pkg) again to recheck the
failed packages. Repeat this process until all ‘*.Rcheck’ directories
As an example, I set
options(repos = c(CRAN =
'https://cran.rstudio.com'), xfun.rev_check.src_dir = '~/Dropbox/repo') in
R_LIBS_USER=~/R-tmp in ‘.Renviron’. Then I
can run, for example,
xfun::rev_check('knitr') repeatedly under a
special directory ‘~/Downloads/revcheck’. Reverse dependencies and their
dependencies will be installed to ‘~/R-tmp’, and knitr will be
installed from ‘~/Dropbox/repo/kintr’.
devtools::revdep_check() is more sophisticated, but currently
has a few major issues that affect me: (1) It always deletes the
(https://github.com/hadley/devtools/issues/1395), which makes it
difficult to know more information about the failures; (2) It does not
fully install the source package before checking its reverse dependencies
(https://github.com/hadley/devtools/pull/1397); (3) I feel it is
fairly difficult to iterate the check (ignore the successful packages and
only check the failed packages); by comparison,
only requires you to run a short command repeatedly (failed packages are
indicated by the existing ‘*.Rcheck’ directories, and automatically
checked again the next time).
xfun::rev_check() borrowed a very nice feature from
devtools::revdep_check(): estimating and displaying the remaining
time. This is particularly useful for packages with huge numbers of reverse
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.