Re: [Rd] [tryExcept] New try Function

2018-11-23 Thread Ernest Benedito
in all, this would be a function for simple error handling, but I think it would be practical, and you can always move to tryCatch if you need a more complex error handling. I will be looking forward to hearing your insights. Best, Ernest Benedito Missatge de Emil Bode del dia dv., 23 de nov. 20

[Rd] [tryExcept] New try Function

2018-11-22 Thread Ernest Benedito
Hi everyone, When dealing with errors, sometimes I want to run a bunch of code when an error occurs. For now I usually use a structure such as: res <- tryCatch(expr, error = function(cond) cond) # or try(expr) if (inherits(res, “error”)) # or inherits(res, “try-error”) # a bunch of code I th