add_deps {rdeps}R Documentation

Add required dependencies to the description file

Description

This function detects external packages used in an R project (package, compendium, website, etc.) and updates the sections Depends, Imports, and Suggests of the DESCRIPTION file.

A DESCRIPTION file can be created and added to an existing project with the function usethis::use_description().

All .R, .Rmd, and .qmd files are screened to identify packages called by library(foo), library("foo"), library('foo'), require(foo), require("foo"), require('foo') or foo::bar().

Different types of dependencies are handled with the following rules:

This function also screens the NAMESPACE file (it detects packages mentioned as import(foo) and importFrom(foo,bar)) and ⁠@examples⁠ sections of roxygen2 headers. The detected packages are added in the Imports section of the DESCRIPTION file.

If the project is not an R package, non-standard folders are also screened (i.e. ⁠analyses/⁠, ⁠paper/⁠, etc.). The detected packages are added in the Imports section of the DESCRIPTION file.

Usage

add_deps()

Value

No return value.

Examples

## Not run: 
add_deps()

## End(Not run)

[Package rdeps version 0.2 Index]