Skip to content

Instantly share code, notes, and snippets.

@PietrH
Forked from nassimhaddad/tryCatch.R
Created January 14, 2021 08:37
Show Gist options
  • Save PietrH/40e2512f02125716e6dfb84330d3dbeb to your computer and use it in GitHub Desktop.
Save PietrH/40e2512f02125716e6dfb84330d3dbeb to your computer and use it in GitHub Desktop.
using trycatch
result = tryCatch({
    expr
}, warning = function(w) {
    warning-handler-code
}, error = function(e) {
    error-handler-code
}, finally {
    cleanup-code
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment