pkg: using::pkg

Description Usage Arguments Details Value Examples

View source: R/pkg.R

Description

Optionally add version constraints to library calls

Usage

1
pkg(package, min_version = NULL, repo = NULL, ...)

Arguments

package

{character | name} package name

min_version

{package_version | character} min package version

repo

{character} repo url

...

additional arguments to pass to base::library()

Details

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}

Value

{character | logical} attached packages, or boolean if logical.return is TRUE

Examples

1
2
3
4
5
6
## 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)

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