detect_dependencies: detect_dependencies

Description Usage Arguments Details Value Author(s)

View source: R/detect_dependencies.R

Description

detect usage of using::pkg in a source file

Usage

1

Arguments

file_path

a length 1 character vector file path to an .R or .Rmd file

Details

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.

Value

a data.frame summarising found using::pkg calls in the supplied file.

Author(s)

Miles McBain


anthonynorth/using documentation built on July 26, 2020, 8:24 a.m.