-
-
Save javieroot/73c26d8a699e262d4ca7ed9728e155d3 to your computer and use it in GitHub Desktop.
using trycatch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
result = tryCatch({ | |
is.numeric(1) | |
# return(TRUE) | |
# no poner return, ya que da error, solo poner TRUE al final si se quiere | |
# una salida TRUE | |
# TRUE | |
# return(0) | |
0 | |
}, warning = function(w){ | |
message("Warning") | |
return(TRUE) | |
}, error = function(e){ | |
message("Error") | |
return(FALSE) | |
}, finally = { | |
message("Final de función") | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment