This gist is a summary of roxygen2 tags, see roxygen2 docs for source of information.
The initial three sections are automatically placed into title, description and details fields of the documentation. The details field is optional.
#' Title goes here
#'
#' Description goes here
#'
#' Details go here (optional)
my_func <- function(x) { }@param name description: name of an argument and a description of the argument.@examples: example code showing how the function is run. Within @examples the code can be wrapped with the folowing tags:\dontrun{}show code in help file but do not run duringexample()calls or checks.\donttest{}show code in help file and run duringexample()calls but not checks.\dontshow{}run the code during checks but do not show in help file. Used for testing, avoid in favour of proper unit tests.
@return description: description of the return value.
Methods in S3 will be automatically parsed, unless there is ambiguity arising from examples such as all.equal.data.frame() which may be interpreted as the all() method for a equal.data.frame class.
@method class function: disambiguate classes and methods. For the above example,@method all.equal data.frame.
@slot name description: name of a slot and a description of the slot.
@rdname name: name of the help file in which to describe the S4 method@describeIn name: name of the help file in which to describe the S4 method
@format description: description of the data format containing the dataset@source description: description of the source of the data, can use\url{}as in@source \url{link.to.source.com}.
It's good to have documentation for a package itself accessible through ?pkgname, in addition to all its functions and datasets. Title and description are inheritied from the DESCRIPTION file, so additional information should be supplied through @details.
#' @details
#' Information about how to use the package
#' @keywords internal
"_PACKAGE"@details: details section describing how to use the package@keywords internal: hide the documentation from the documentation index.
"_PACKAGE" allows this documentation to be accessed through ?pkgname and package?pkgname.