Skip to contents

Returns a predefined label intended to be used to document function return values using roxygen2's @return tag. Shorthand for roxy_lbl(type = "return").

Usage

return_lbl(id = roxy_lbls(type = "return")$id, ...)

Arguments

id

Label identifier. See roxy_lbls() for possible values.

...

Further named arguments passed on to roxy_lbl().

Value

A glue character scalar.

Details

A label can be inserted using inline R code as follows:

#' @return `r pkgsnip::return_lbl("ID")`

Note that the above only works in roxygen2 7.1.0+.

Currently, the following return labels are available:

idarguments
cli_markup_support
date
dates
datetime
datetimes
dbi_connection
df_or_tibble
dm
dyn_dots_support
end_date
eol
funky_configpkg
ggplot2_obj
glue_chr
gt_obj
http_methodone_of
max_cache_age
max_tries
num_vrsn
opt_global_max_cache_agepkg, global_max_cache_age
path
paths
pkg
plotly_obj
quiet
r_obj
resp_obj
show_progress
start_date
strict_list
sym
tbl_data
tibble
tibble_colscols
tibble_customcustom
tidy_select_support
use_cache

Note that the pkg argument defaults to the name of the package from which this function is called (NULL if not run within a package environment).

See also

Examples

pkgsnip::return_lbl(id = "dyn_dots_support")
#> [Dynamic dots][rlang::dyn-dots] are supported.

# some labels take additional arguments
pkgsnip::return_lbl(id = "funky_config",
                    pkg = "foo")
#> A [tibble][tibble::tbl_df] with data about all possible foo package configuration options. See [funky::config_val()] for more information.

# note that the `pkg` argument always defaults to the current package
# (none if run from the global environment)
pkgsnip::return_lbl(id = "funky_config")
#> A [tibble][tibble::tbl_df] with data about all possible pkgsnip package configuration options. See [funky::config_val()] for more information.