# No errors or warnings
try_catch_warnings(log(2))
# Warnings
try_catch_warnings(log(-1))
# Errors
try_catch_warnings(stop("Error Message"))
try_catch_warnings(stop("Error Message"), character = TRUE)
Run the code above in your browser using DataLab