This uses renv::dependencies(), which scans your project directory for package-dependency declarations. It compares packages detected in the code with those declared in the DESCRIPTION to determine missing and extra package-dependency declarations.

By default, proj_upate_deps() will not remove extra package-dependency declarations; you can change this by using remove_extra = TRUE.

proj_check_deps()

Prints missing and extra dependencies.

proj_update_deps()

Updates DESCRIPTION file with missing and extra dependencies.

proj_check_deps(path = usethis::proj_get())

proj_update_deps(path = usethis::proj_get(), remove_extra = FALSE)

Arguments

path

character, path to the project directory. If your current working-directory in is in the project, the default will do the right thing.

remove_extra

logical, indicates to remove dependency-declarations that renv::dependencies() can't find being used.

Value

Invisible NULL, called for side effects.

Examples

# not run because it produces side effects
if (FALSE) {

  # check DESCRIPTION for missing and extra dependencies
  proj_check_deps()

  # update DESCRIPTION with missing dependencies
  proj_update_deps()
}