Description Usage Arguments Details Value Author(s)
View source: R/detect_dependencies.R
detect usage of using::pkg in a source file
1 | detect_dependencies(file_path)
|
file_path |
a length 1 character vector file path to an .R or .Rmd file |
Intended for use when building lock files (e.g. for renv) from source files.
returns a data.frame of all information in using::pkg calls with columns:
package
, min_version
, repo
. The value of a row may be NA if the
argument was not supplied.
Each result row is guaranteed to be unique, however the result data frame may contain near duplicates, e.g. using::pkg(janitor, min_version = "2.0.1") and using::pkg(janitor, min_version = "1.0.0") would each create a row in the result data frame if they appeared in the same file, due to differing min_version.
Each using::pkg call is parsed based on it's literal expression and no variable substitution is done. So using(janitor, min_version = janitor_ver) would place "janitor_ver" in the min_row column of the result for this dependency.
a data.frame summarising found using::pkg calls in the supplied file.
Miles McBain
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.