View source: R/error_handling.R
throws_error | R Documentation |
Parses a string as a call and determines whether it returns an error or not. Returns a boolean.
throws_error(expr, silent_try = T)
expr |
(expr) An expression. |
silent_try |
(lgl scalar) Whether to use a silent try. |
throws_error(log("")) #cannot take a logarithm of a string
throws_error(log(0)) #can take logarithm of 0
throws_error("log(0)") #works on strings too
throws_error("log(NULL)") #works on strings too
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.