Enumerate multiple elements of a vector or list.
Arguments
- x
A vector or list
- quote_fun
Quoting function, defaults to
backquote
. If set toNULL
, the elements are not quoted.- conjunction
Character to be used in the message, defaults to
"and"
.
Examples
enumerate(c("one", "two", "three"))
#> Warning: `enumerate()` was deprecated in admiraldev 1.1.0.
#> ℹ This function was primarily used in error messaging, and can be replaced with
#> 'cli' functionality: `cli::cli_abort('{.val {letters[1:3]}}')`
#> [1] "`one`, `two` and `three`"
enumerate(c(1, 2, 3), quote_fun = NULL)
#> [1] "1, 2 and 3"