stop_input_type(x, "a numeric vector", arg = I(glue("Element {i} of `x`"))
#> Element 5 of `x` must be a numeric vector, not a factor.
Useful if you are mapping over a user supplied list (like if the user supplied ...) and you want to check that each one is a particular type. Otherwise I'd end up calling cli_abort() directly to completely control the error message
So you can do something like:
Useful if you are mapping over a user supplied list (like if the user supplied
...
) and you want to check that each one is a particular type. Otherwise I'd end up callingcli_abort()
directly to completely control the error message