make.Rd.roclet {roxygen}R Documentation

Make an Rd roclet which parses the given files and, if specified, populates...

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

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
@keywords \keyword, ...
@method \method
@name \name
@note \note
@param \arguments{\item, ...}
@references \references
@return \value
@seealso \seealso
@title \title
@TODO n/a
@usage \usage
    @author
    See “2.1.1 Documenting functions” from Writing R Extensions.
    @aliases
    A 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.
    @concept
    See “2.8 Indices” from Writing R Extensions.
    @example
    Each @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{...}.
    @examples
    Verbatim examples; see “2.1.1 Documenting functions” from Writing R Extensions.
    @keywords
    @keywords a b ... translates to \keyword{a}, \keyword{b}, &c.
    @method
    Use @method <generic> <class> to document S3 functions.
    @name
    In the absense of an explicit @name tag, the name of an assignment is plucked from the assignee.
    @note
    See “2.1.1 Documenting functions” from Writing R Extensions.
    @param
    Each function variable should have a @param <variable> <description> specified.
    @references
    See “2.1.1 Documenting functions” from Writing R Extensions.
    @return
    The return value of the function, or NULL.
    @seealso
    See “2.1.1 Documenting functions” from Writing R Extensions.
    @title
    A 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.
    @TODO
    Note to developers to get off their asses.
    @usage
    A 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

Examples

#' 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')

[Package roxygen version 0.1 Index]