addPid: Add :: ('<package>::<function>') notation to package...

Description Usage Arguments Details Value Author(s) Examples

View source: R/addPid.R

Description

Scan a file of R code for the presence of functions from packages installed on machine or a custom list of packages.

Usage

1
addPid(r_script, packages = NULL, ignore = NULL, detach = TRUE)

Arguments

r_script

A connection to a file (.R or .Rmd) containing package functions.

packages

Optionally specify a character vector of packages to be searched for.

ignore

Optional character vector of package names to ignore.

detach

Logical stating whether packages should be detached after input. Default is TRUE.

Details

Add :: notation to functions so that packages are directly referenced in their calls. R package development requires not attaching packages and instead loading them directly by package::function. This function and package exists to negate manually appending package identifyers to corresponding functions in R code.

Value

An edited .R file written to the same directory as input file.

Author(s)

Spencer Seale

Examples

1
2
3
4
## Not run: 
addPid("/path/to/r/script")

## End(Not run)

spencerseale/addPid documentation built on March 12, 2021, 7:32 a.m.