Skip to contents

Alternative return for error statements.Return alternative if the value of expression is erroneous

Usage

error.out(test, alternative = "")

test %eo% alternative

Arguments

test

an object to return

alternative

alternative object to return

Value

value of test if error, else return value of alternative

Examples

# The following statement would produce
# error because 'stat1' does not exist

# stat1 + 1

# To prevent the statement from
# stopping the process, when can have alternative out
alt = 0
error.out(stats1 + 1, alt)
#> [1] 0