Checking reverse dependencies: the tiny way

The tools package that comes with base R makes checking reverse dependencies super easy.

  1. Build your package tarball (the pkg_x.y.z.tar.gz file).

    R CMD build /your/package/location

It is a good idea to make sure that the tarball is in a dedicated directory, because the next step will download and install reverse dependencies in the directory where the tarball resides.

  1. In an R terminal type

result <- check_packages_in_dir("/directory/containing/tarball"
                    , reverse = list() )

The result can be printed and summarized and analyzed further if there is any breakage. Here's an example of output when I ran this on my gower package today.


> result
Check results for packages in dir '/home/mark/projects/gower/output':
Package sources: 1, Reverse depends: 5
Use summary() for more information.
> summary(result)
Check results for packages in dir '/home/mark/projects/gower/output':

Check status summary:
                  ERROR NOTE OK
  Source packages     0    0  1
  Reverse depends     1    3  1

Check results summary:
gower ... OK
rdepends_ceterisParibus ... NOTE
* checking dependencies in R code ... NOTE
rdepends_lime ... ERROR
* checking tests ... ERROR
* checking re-building of vignette outputs ... WARNING
rdepends_live ... NOTE
* checking dependencies in R code ... NOTE
rdepends_recipes ... NOTE
* checking dependencies in R code ... NOTE
rdepends_simputation ... OK

(Checking the logs in output/rdepends_lime.Rcheck/00check.log shows that lime fails because of a missing JAVA engine [I just updated my OS and have no JAVA installed yet].)

Notes

  1. Checking reverse dependencies can be done in parallel by setting the Ncpus argument larger than one.
  2. Be aware that the documentation states that (R 3.5.2) This functionality is still experimental: interfaces may change in future versions. Nevertheless, it has worked fine for me so far.
This entry was posted in programming, R and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.

*