make.Rd.roclet: Make an Rd roclet which parses the given files and, if...

Description Usage Arguments Details Value TODO Examples

Description

Make an Rd roclet which parses the given files and, if specified, populates the given subdirectory with Rd files; or writes to standard out. See Writing R Extensions (http://cran.r-project.org/doc/manuals/R-exts.pdf) for details.

Usage

1
make.Rd.roclet(subdir, verbose=TRUE)

Arguments

subdir

directory into which to place the Rd files; if NULL, standard out.

verbose

whether to declare what we're doing in the subdir

Details

The first paragraph of a roxygen block constitutes its description, the subsequent paragraphs its details; moreover, the Rd roclet supports these tags:

Roxygen tag Rd analogue
@author \author
@aliases \alias, ...
@concept \concept
@example n/a
@examples \examples
@format \format
@keywords \keyword, ...
@method \method
@name \name
@note \note
@param \arguments{\item, ...}
@references \references
@return \value
@seealso \seealso
@source \source
@title \title
@TODO n/a
@usage \usage
  1. @authorSee “2.1.1 Documenting functions” from Writing R Extensions.

  2. @aliasesA default alias is plucked from the @name or assignee; otherwise, @alias a b ... translates to \alias{a}, \alias{b}, &c. If you specify one alias, however, specify them all.

  3. @conceptSee “2.8 Indices” from Writing R Extensions.

  4. @exampleEach @example tag specifies an example file relative to the package head; if the file resides in ‘tests’, for instance, it will be checked with R CMD check. The contents of the file will be concatenated under \examples{...}.

  5. @examplesVerbatim examples; see “2.1.1 Documenting functions” from Writing R Extensions.

  6. @formatSee “2.1.2 Documenting data sets” from Writing R Extensions.

  7. @keywords@keywords a b ... translates to \keyword{a}, \keyword{b}, &c.

  8. @methodUse @method <generic> <class> to document S3 functions.

  9. @nameIn the absense of an explicit @name tag, the name of an assignment is plucked from the assignee.

  10. @noteSee “2.1.1 Documenting functions” from Writing R Extensions.

  11. @paramEach function variable should have a @param <variable> <description> specified.

  12. @referencesSee “2.1.1 Documenting functions” from Writing R Extensions.

  13. @returnThe return value of the function, or NULL.

  14. @seealsoSee “2.1.1 Documenting functions” from Writing R Extensions.

  15. @sourceSee “2.1.2 Documenting data sets” from Writing R Extensions.

  16. @titleA default title is plucked from the first sentence of the description; that is, the first phrase ending with a period, question mark or newline. In the absence of a description, the title becomes the @name or assignee; lastly, it can be overridden with @title.

  17. @TODONote to developers to get off their asses.

  18. @usageA default usage is construed from a function's formals, but can be overridden with @usage (e.g. in the case of multiple functions in one Rd unit).

Value

Rd roclet

TODO

param method setClass setGeneric setMethod make.Rd.roclet

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
#' This sentence describes the function.
#'
#' Here are the details (notice the preceding blank
#' line); the name, title, usage and alias will be
#' automatically generated.
#'
#' @param a a parameter
#' @return NULL
f <- function(a=1) NULL

#' S3 functions require a @method tag for
#' the time being.
#'
#' @method specialize foo
#' @param f a generic foo
#' @param ... ignored
#' @return The specialized foo
specialize.foo <- function(f, ...)
actually.specialize(f)

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

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