roxy_tag_rd.roxy_tag_iparam | R Documentation |
@iparam
tagsThe @iparam <name> <description>
tag can be used in roxygen2
documentation
of a function to describe a dataframe parameter. The function must be using
interfacer::iface
to define the input dataframe parameter format. The
@iparam
tag will then generate documentation about the type of dataframe
the function is expecting.
## S3 method for class 'roxy_tag_iparam'
roxy_tag_rd(x, base_path, env)
x |
The tag |
base_path |
Path to package root directory. |
env |
Environment in which to evaluate code (if needed) |
an roxygen2::rd_section
(see roxygen2
documentation)
# An example function definition:
fn_definition <- "
#' This is a title
#'
#' This is the description.
#'
#' @md
#' @iparam df the input
#' @export
f <- function(df = interfacer::iface(
id = integer ~ \"an integer `ID`\",
test = logical ~ \"the test result\"
)) {
ivalidate(df)
}
"
# For this example we manually parse the function specification in `fn_definition`
# creating a .Rd block - normally this is done by `roxygen2` which then
# writes this to an .Rd file. This function is not intended to be used
# outside of a call to `devtools::document`.
tmp = roxygen2::parse_text(fn_definition)
print(tmp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.