make.namespace.roclet: Make a namespace roclet which parses the given files and...

Description Usage Arguments Details Value Examples

Description

Make a namespace roclet which parses the given files and writes a list of namespace directives to a given file or standard out; see Writing R Extensions (http://cran.r-project.org/doc/manuals/R-exts.pdf) for details.

Usage

1
make.namespace.roclet(outfile="", verbose=TRUE)

Arguments

outfile

whither to send output; blank string means standard out

verbose

whether to anounce what we're doing with the outfile

Details

The namespace roclet supports the following tags:

Roxygen tag NAMESPACE’ equivalent
@export export
@exportClass exportClasses
@exportMethod exportMethod
@exportPattern exportPattern
@S3method S3method
@import import
@importFrom importFrom
@importClassesFrom importClassesFrom
@importMethodsFrom importMethodsFrom
  1. @exportMay be specified with or without value; if unadorned, roxygen will try to guess the exported value by assignee, setMethod, setClass, etc. Otherwise, @export f g ... translates to export(f, g, ...).

  2. @exportClassOverrides setClass.

  3. @exportMethodOverrides setMethod or setGeneric.

  4. @exportPatternSee “1.6.2 Registering S3 methods” from Writing R Extensions.

  5. @S3methodOverrides the export of an S3 method.

  6. @importSee “1.6.1 Specifying imports and exports” from Writing R Extensions.

  7. @importFromSee “1.6.1 Specifying imports and exports” from Writing R Extensions.

  8. @importClassesFromSee “1.6.6 Name spaces with formal classes and methods” from Writing R Extensions.

  9. @importMethodsFromSee “1.6.6 Name spaces with formal classes and methods” from Writing R Extensions.

Value

Namespace roclet

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#' An example file, example.R, which imports
#' packages foo and bar
#' @import foo bar
roxygen()

#' An exportable function
#' @export
fun <- function() {}

roclet <- make.namespace.roclet()
## Not run: roclet$parse('example.R')

roxygen documentation built on May 2, 2019, 4:44 p.m.