Title: | Add version constraints to library() calls |
---|---|
Description: | Add version constraints and remote git repositories to library() calls. In interactive mode the user is prompted to install. |
Authors: | Anthony North [aut, cre], Miles McBain [aut], Mango Solutions [cph], RStudio [cph] |
Maintainer: | Anthony North <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.4.0 |
Built: | 2024-12-28 02:37:50 UTC |
Source: | https://github.com/anthonynorth/using |
detect usage of using::pkg in a source file
detect_dependencies(file_path)
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
Optionally add version constraints to library calls
pkg(package, min_version = NULL, repo = NULL, ...)
pkg(package, min_version = NULL, repo = NULL, ...)
package |
|
min_version |
|
repo |
|
... |
additional arguments to pass to |
This function is intended to always be called with the using::
prefix. A
call without this prefix will throw a warning. This simplifies detecting
dependencies declared by using::pkg for use with {renv}
and {capsule}
{character | logical}
attached packages, or boolean if logical.return is TRUE
## Not run: using::pkg(capsule) using::pkg(dplyr, min_version = "0.8.0") using::pkg(h3jsr, min_version = "1.0.0", repo = "https://github.com/obrl-soil/h3jsr") ## End(Not run)
## Not run: using::pkg(capsule) using::pkg(dplyr, min_version = "0.8.0") using::pkg(h3jsr, min_version = "1.0.0", repo = "https://github.com/obrl-soil/h3jsr") ## End(Not run)
Optionally add version constraints to library calls
using(...)
using(...)
... |
arguments to pass to |
This is function is deprecated. See using::pkg()
.
{character | logical}
attached packages, or boolean if logical.return is TRUE
## Not run: using::pkg(capsule) using::pkg(dplyr, min_version = "0.8.0") using::pkg(h3jsr, min_version = "1.0.0", repo = "https://github.com/obrl-soil/h3jsr") ## End(Not run)
## Not run: using::pkg(capsule) using::pkg(dplyr, min_version = "0.8.0") using::pkg(h3jsr, min_version = "1.0.0", repo = "https://github.com/obrl-soil/h3jsr") ## End(Not run)