Description Usage Arguments Details Value TODO Examples
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.
1 | make.Rd.roclet(subdir, verbose=TRUE)
|
subdir |
directory into which to place the Rd files; if
|
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 |
@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 |
@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.
@format
See “2.1.2 Documenting data sets” 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.
@source
See “2.1.2 Documenting data sets” 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).
Rd roclet
param method setClass setGeneric setMethod make.Rd.roclet
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')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.