make.Rd.roclet {roxygen} | R Documentation |
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.
make.Rd.roclet(subdir, verbose=TRUE)
subdir |
directory into which to place the Rd files; if
NULL , standard out. |
verbose |
whether to declare what we're doing in the subdir |
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
@aliases
@name
or
assignee; otherwise, @alias a b ...
translates
to \alias{a}
, \alias{b}
, &c.
If you specify one alias, however, specify them all.@concept
@example
@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
@keywords
@keywords a b ...
translates to
\keyword{a}
, \keyword{b}
, &c.@method
@method <generic> <class>
to document
S3 functions.@name
@name
tag, the
name of an assignment is plucked from the assignee.@note
@param
@param <variable> <description>
specified.@references
@return
NULL
.@seealso
@title
@name
or assignee; lastly, it can be
overridden with @title
.@TODO
@usage
@usage
(e.g. in the case
of multiple functions in one Rd unit).Rd roclet
#' 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')