ecycle: Frame Work for Handling Errors in a Batch Process

Description Usage Arguments Value Examples

Description

See arguments.

Usage

1
ecycle(code, ehandle, max_try, thandle, ecorrect, cond = TRUE)

Arguments

code

The code block to run

ehandle

The code block to run when running code fails

max_try

The number of attempts to run code before claiming that code fails

thandle

(Optional) The code block to run when running code succeeds

ecorrect

(Optional) The code block to run after running code doesn't succeed and before running code again

cond

(Optional) Additional conditions for deciding that running code succeeds.

Value

If running code fails, the result of ehandle.

If running code succeeds and thandle is missing, the result of code.

If running code succeeds and thandle isn't missing, the result of thandle.

Examples

1
2
ecycle({a <-1; print(a+b); b <- 2}, print('failed'), 3, print('succeeded'), b <- 3)
print(b)

batchscr documentation built on May 6, 2019, 9 a.m.