roxy_tag_rd.roxy_tag_iparam: Support for @iparam tags

View source: R/devtools.R

roxy_tag_rd.roxy_tag_iparamR Documentation

Support for ⁠@iparam⁠ tags

Description

The ⁠@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.

Usage

## S3 method for class 'roxy_tag_iparam'
roxy_tag_rd(x, base_path, env)

Arguments

x

The tag

base_path

Path to package root directory.

env

Environment in which to evaluate code (if needed)

Value

an roxygen2::rd_section (see roxygen2 documentation)

Examples


# 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)


interfacer documentation built on April 4, 2025, 6:13 a.m.