search for: ebeneditos

Displaying 3 results from an estimated 3 matches for "ebeneditos".

2018 Nov 23
1
[tryExcept] New try Function
...ofcode, or use #abunchofcode to return > to a higher level, so I get it you're looking for a more elegant solution. > > Best regards, > Emil Bode > > ?On 23/11/2018, 08:49, "R-devel on behalf of Ernest Benedito" < > r-devel-bounces at r-project.org on behalf of ebeneditos at gmail.com> wrote: > > 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) > &...
2018 Nov 22
2
[tryExcept] New try Function
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 though it would be useful to have a function that does this naturally, so I came up with the attached
2018 Nov 23
0
[tryExcept] New try Function
...cess the error-object in #abunchofcode, or use #abunchofcode to return to a higher level, so I get it you're looking for a more elegant solution. Best regards, Emil Bode ?On 23/11/2018, 08:49, "R-devel on behalf of Ernest Benedito" <r-devel-bounces at r-project.org on behalf of ebeneditos at gmail.com> wrote: 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?)...