writeNamespaceImports: Write NAMESPACE file imports statements

View source: R/writeNamespaceImports.R

writeNamespaceImportsR Documentation

Write NAMESPACE file imports statements

Description

Writes imports statements that can be included in a package's NAMESPACE file.

Usage

writeNamespaceImports(package, file = "", append = TRUE, quote = FALSE,
                      width = 0.9 * getOption("width"))

Arguments

package

the quoted name of the package to analyze.

file

either a character string naming a file or an open writing connection. "" indicates writing to the console.

append

logical. If TRUE, the output is appended to the file. If FALSE, any existing file with the specified name is destroyed and a new one is created. This argument is only used if file is a character string.

quote

logical. If TRUE, all import fields will be double-quoted. If FALSE, only non-standard names like [<-.fractions will be double-quoted.

width

a positive integer giving the target column for wrapping lines in the output.

Details

The result is an approximation based upon the findings of findExternalDeps. S4 class dependencies are embedded into importClassesFrom statements, S4 methods dependencies are embedded into importMethodsFrom statements, and all other dependencies are embedded into importFrom statements.

See the document "Writing R Extensions" that is hosted on CRAN for more details on the proper construction of a NAMESPACE file.

Author(s)

Patrick Aboyoun

See Also

findExternalDeps

Examples

library(stats4)
writeNamespaceImports("stats4")

Bioconductor/codetoolsBioC documentation built on April 25, 2023, 11:05 a.m.