powered by
See arguments.
ecycle(code, ehandle, max_try, thandle, ecorrect, cond = TRUE)
The code block to run
The code block to run when running code fails
code
The number of attempts to run code before claiming that code fails
(Optional) The code block to run when running code succeeds
(Optional) The code block to run after running code doesn't succeed and before running code again
(Optional) Additional conditions for deciding that running code succeeds.
If running code fails, the result of ehandle.
ehandle
If running code succeeds and thandle is missing, the result of code.
thandle
If running code succeeds and thandle isn't missing, the result of thandle.
# NOT RUN { ecycle({a <-1; print(a+b); b <- 2}, print('failed'), 3, print('succeeded'), b <- 3) print(b) # }
Run the code above in your browser using DataLab