powered by
N.B. This only works for the specific environment (to prevent weird side effects)
check_integer( ..., .message = "`{param}` is not an integer ({err}).", .env = rlang::caller_env() )
nothing. called for side effects. throws error if not all variables can be coerced.
a list of symbols
a glue specification containing {param} as the name of the parameter and {err} the cause of the error
{param}
{err}
the environment to check (defaults to calling environment)
a = c(1:4) b = c("1",NA,"3") f = NULL g = NA check_integer(a,b,f,g) c = c("dfsfs") e = c(1.0,2.3) try(check_integer(c,d,e, mean))
Run the code above in your browser using DataLab