Convenience function combining fn_param_defaults(), wrap_chr() and cli::ansi_collapse().
Usage
enum_fn_param_defaults(
param,
fn = sys.function(sys.parent()),
env = parent.frame(),
wrap = "`",
sep2 = " or ",
last = sep2,
...
)Arguments
- param
Parameter name. A character scalar.
- fn
A function or a function name (searched for in
env). Seebase::formals()for details.- env
Environment
fnis defined in. Seebase::formals()for details.- wrap
Character sequence the default parameter values are to be wrapped in. A character vector or something coercible to.
- sep2, last
Passed on to
cli::ansi_collapse().- ...
Further arguments passed on to
cli::ansi_collapse().
Details
This function can be very convenient to avoid duplication in roxygen2 documentation by leveraging inline R code evaluation as follows:
See also
Other package documentation functions:
fn_param_defaults(),
roxy_blocks(),
roxy_obj(),
roxy_tag_value(),
roxy_to_md_links()
