Description Usage Arguments Details Examples
View source: R/add_dependencies.R
This function detects dependencies used in R/
, NAMESPACE
, and @examples
and automatically adds these dependencies in Imports section of the
DESCRIPTION
file.
1 | add_dependencies(path = ".", import = NULL, suggest = "vignettes")
|
path |
the path to the package/research compendium (must have a
|
import |
(optional) the name of the folder to recursively detect
dependencies to be added in the Imports field of |
suggest |
the name of the folder to recursively detect dependencies to
be added in the Suggests field of |
In the NAMESPACE
file it detects dependencies mentionned as import(pkg)
and importFrom(pkg,fun)
.
In the R/
folder it detects functions called as pkg::fun()
in the code
of each R files. In @examples
section it also detects packages attached
using library(pkg)
or require(pkg)
.
The folder vignettes/
is also inspected and detected dependencies
(pkg::fun()
, library(pkg)
or require(pkg)
) are added in the section
Suggests of the DESCRIPTION
file.
If the project is a research compendium user can also inspect one
additional folder (i.e. analysis/
) with the argument import
to detected
dependencies to be added in the section Imports of the DESCRIPTION
file. The detection process is the same as the one used for vignettes/
.
1 2 3 4 | ## Not run:
add_dependencies()
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.