powered by
The two functions has_warning() and has_error() check if an expression produces warnings and errors, respectively.
has_warning()
has_error()
has_warning(expr)has_error(expr, silent = !interactive())
has_error(expr, silent = !interactive())
an R expression
logical: should the report of error messages be suppressed?
A logical value.
# NOT RUN { has_warning(1 + 1) has_warning(1:2 + 1:3) has_error(2 - 3) has_error(1 + "a") has_error(stop("err"), silent = TRUE) # }
Run the code above in your browser using DataLab