Generate @importFrom directives

Usage

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

Arguments

...
[character(1)] Packages to generate @importFrom directives for.
.pkgs
[character() or list()] Packages to generate @importFrom directives for, as list.
.output
[character(1)] What should happen with the generated directives? 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 @importFrom roxygen directives that import all symbols in a package.

Examples

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