Generate import::from calls

Usage

from(..., .pkgs = NULL, .output = c("clipboard", "cat", "return"), .comment = TRUE)

Arguments

...
[character(1)] Packages to generate import calls for.
.pkgs
[character() or list()] Packages to generate import calls for, as list.
.output
[character(1)] What should happen with the generated calls? If "clipboard" (default), copy to clipboard. If "cat", print to the console. If "return", simply return as a character vector.
.comment
[logical(1)] Should comments be prepended to the generated code? Default: TRUE.

Value

[character()]

The generated output, invisibly unless output is set to "return".

Description

This function generates calls to import::from that imports all symbols in a package.

Examples

from("rpart", .output = "cat")
# The imports below were generated using the following call: # import.gen::from("rpart") import::from("rpart", "meanvar", "na.rpart", "path.rpart", "plotcp", "post", "printcp", "prune", "prune.rpart", "rpart", "rpart.control", "rpart.exp", "rsq.rpart", "snip.rpart", "xpred.rpart")