find_deps | R Documentation |
A quick-and-dirty diagnostic tool to find dependency usage within top-level expressions (e.g. declared functions) in R scripts within a development package.
find_deps(path = ".", threshold = NULL)
path |
Path to the base directory of a package. |
threshold |
Only report on dependencies used in fewer than this many top-level expressions. |
This might be useful for package developers hoping to use need()
in their package, and looking for good candidates for dependencies which
could be moved from Imports
to Suggests
in the DESCRIPTION
file.
Dependencies are searched for in two ways:
import()
and importFrom()
statements in the package's NAMESPACE
file, such as those created by @import
and @importFrom
tags if
creating package documentation with roxygen2
Functions called by using ::
or :::
to access a dependency's namespace
directly
This approach isn't perfect, but it should capture most dependency uses.
A data frame, with one row per distinct top-level expression where a package is used. Packages used in the fewest places are listed first.
find_deps(system.file("demopkg", package = "suggests"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.