Skip to content

revdepcheck

Martina Morris edited this page Apr 26, 2021 · 2 revisions

revdepcheck is a package that automates the reverse dependency checking process. It's a marvel. I've only used the package from the Rstudio interface, so my instructions here will reflect that.

Installation

revdepcheck only lives on GitHub, not on CRAN, so you need devtools::install_github. In addition, the usethis package automates some setup tasks, so it's worth installing that also (from CRAN).

Usage

From Rstudio, open the project for the package you want to check. The set of basic tasks for generating the list of problems and failures in reverse dependent packages are listed below.

# Install/Update revdepcheck package (if necessary)
devtools::install_github("r-lib/revdepcheck")

# Reset revdepcheck (if necessary, when you still have the output from a previous run present)
revdepcheck::revdep_reset()

# Setup -- automates the standard tasks (see https://usethis.r-lib.org/reference/use_revdep.html)
usethis::use_revdep()

# Run -- may need to run multiple times if there are lots of depends.
# If it stops before finishing, just restart the revdepcheck, it will automatically pick up where it
# left off (see https://rdrr.io/github/r-lib/revdepcheck/man/revdep_check.html)
revdepcheck::revdep_check(num_workers = 4, # this can be more
                          timeout = as.difftime(60, units = "mins"))

revdepcheck can also automate the process of emailing dependent package maintainers. Some examples shown below, for more info see the package documentation

# get revdep email addresses for package maintainers
emails <- revdepcheck::revdep_maintainers()
write(emails, file = here::here("revdep", "pkg_maintainer_emails.txt")) # note use of `here` package

# review draft emails for maintainers
revdepcheck::revdep_email_draft()

# send emails to maintainers -- requires gmail authorization, see documentation
revdepcheck::revdep_email()

Output from the package

The output is stored in a new revdep folder in the repository. You'll want to commit this to the GH repo so others can see the results (esp. the revdep package maintainers). Key files are in .md format so they are nicely formatted for online viewing.

Key output files include:

  • README.md -- a summary of the checks that produced warnings or errors (best short summary)
  • two .md files with detailed info on problems and failures (useful for dependent package maintainers also)
  • email.yml -- a template for the automation of emails to dependent package maintainers. You'll need to edit this if you want to use it.