Skip to content

Learn full the details in in vignette('reuse').

Key tags:

  • @describeIn {destination} {description}: Document a function or method in the destination topic.

  • @inherit {source} {components}: Inherit one or more documentation components from another topic. If components is omitted, all supported components will be inherited. Otherwise, specify individual components to inherit by picking one or more of params, return, title, description, details, seealso, sections, references, examples, author, source, and note.

  • @inheritDotParams {source} {arg1 arg2 arg3}: Automatically generate documentation for ... when you're passing dots along to another function.

  • @inheritParams {source}: Inherit argument documentation from another function. Only inherits documentation for arguments that aren't already documented locally.

  • @inheritSection {source} {section name}: Inherit a specific named section from another topic.

  • @order {number}: Override the default (lexigraphic) order in which multiple blocks are combined into a single topic.

  • @rdname {topic-name}: Override the file name of generated .Rd file. Can be used to combine multiple blocks into a single documentation topic.

Other less frequently used tags:

  • @eval {r-code}: Evaluate arbitrary code in the package namespace and insert the results back into the block. Should return a character vector of lines.

  • @evalRd {r-code}: Evaluate arbitrary code in the package namespace and insert the results back as into the block. Should return a character vector of lines.

  • @includeRmd {path}: Insert the contents of an .Rmd into the current block. Superseded in favour of using a code chunk with a child document.

  • @template {path-to-template}: Use a roxygen2 template. Now superseded in favour of inline R code.

  • @templateVar {name} {value}: Define variables for use in a roxygen2 template.

Usage

#' @describeIn {destination} {description}
#' @eval {r-code}
#' @evalRd {r-code}
#' @includeRmd {path}
#' @inherit {source} {components}
#' @inheritDotParams {source} {arg1 arg2 arg3}
#' @inheritParams {source}
#' @inheritSection {source} {section name}
#' @order {number}
#' @rdname {topic-name}
#' @template {path-to-template}
#' @templateVar {name} {value}

See also

Other documentation tags: tags-index-crossref, tags-rd-other, tags-rd