as_params | R Documentation |
@param
roxygen sections for optionsGenerate parameter documentation based on option behaviors. Especially useful for ubiquitous function parameters that default to option values.
as_params(...)
... |
Character values of options to use. If named arguments are provided, the option description provided as the value is mapped to a parameter of the argument's name. |
A character vector of roxygen2
@param
tags
Other options_roxygen2:
as_roxygen_docs()
options::define_options(
"whether messages should be written softly, or in all-caps",
quiet = TRUE
)
#' Hello, World
#'
#' @eval options::as_params("softly" = "quiet")
#'
hello <- function(who, softly = opt("quiet")) {
say_what <- paste0("Hello, ", who, "!")
if (quiet) say_what else toupper(say_what)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.