e_is_error | R Documentation |
check a function and if there's an error return an indication that we can ifelse() to either run for real or skip
e_is_error(f)
f |
report result of a |
TRUE/FALSE for error
sw_try_ok <-
!e_is_error(
try(
# try what you want, check for error
log(NULL)
)
)
if(sw_try_ok) {
# no error, do what you intended to do
} else {
# error, do something else
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.