Description Usage Arguments Details Value Author(s) Examples
This is essentially a wrapper around renv::dependencies()
, but returns
the packages as a character vector which can be supplied directly to
install.packages()
or similar. In addition, it figures out which packages
are installed from GitHub and prepends the correct username/organization to
the package name, for use in e.g. remotes::install_github()
or
BiocManager::install()
. Optionally, an R script is written containing
code to install the packages.
1 | find_project_dependenices(path = ".", write_script = FALSE)
|
path |
Path to the project to be parsed. Used the current directory by default. |
write_script |
Should an install script be written? Can be either
logical or a character string containing the name of the file to be
written. Default: |
NOTE that this function only works in projects with
renv set up! At the least, it requires a
renv.lock
file
to be present.
If write_script = FALSE
, returns a character vector of all packages
used in the project. If write_script = TRUE
, writes a file install.R
(or a custom file name if provided) containing code to install all found
packages.
Milan Malfait
1 2 3 4 5 6 7 8 | ## Not run:
find_project_dependencies()
## Writing to a custom file
tmp <- tempfile()
find_project_dependencies(write_script = tmp)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.