Learn R Programming

safestats (version 0.8.7)

tryOrFailWithNA: Tries to Evaluate an Expression and Fails with NA

Description

The evaluation fails with NA by default, but it is also able to fail with other values.

Usage

tryOrFailWithNA(expr, value = NA_real_)

Value

Returns the evaluation of the expression, or value if it doesn't work out.

Arguments

expr

Expression to be evaluated.

value

Return value if there is an error, default is NA_real_.