Fail_With: Fail with a default value.

Description Usage Arguments Value See Also

View source: R/Fail-With.R

Description

Fail_With() turns a function that throws an error into a function that returns a default value when there is an error. The essence of Fail_With() is simple: it is just a wrapper around try(), the function that captures errors and allows execution to continue.

Usage

1
Fail_With(.default = NULL, .f, .silent = FALSE)

Arguments

.default

default value.

.f

any function that throws an error.

.silent

logical: should the report of error messages be suppressed?

Value

a function that returns a default value when there's an error.

See Also

Other function operators: Compose, %O%; Memoise; Partial; Reduce_Right


paulhendricks/functools documentation built on May 24, 2019, 8:41 p.m.