tcwarn | R Documentation |
Easy Try/Catch implementation to return the same message as a warning on error or warning. Makes it easier to write tryCatches. Author: Bryce Chamberlain. Tech review: Lindsay Smelzter.
tcwarn(code_block, ...)
code_block |
Code to run in Try Catch. |
... |
Strings to concatenate to form the message that is returned. |
tryCatch({
tcwarn({ NULL = 1 },'Cannot assign to NULL','variable')
},
warning = function(e) print( e )
)
tryCatch({
tcwarn({ as.numeric('abc') },'Issue in as.numeric()')
},
warning = function(e) print( e )
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.