attempt: Attempt

Description Usage Arguments Examples

View source: R/adverbs.R

Description

A wrapper around base try that allows you to set a custom message when an error/warning occurs. attempt returns the value if there is no error nor message.

Usage

1
attempt(expr, msg = NULL, verbose = FALSE, silent = FALSE)

Arguments

expr

the expression to be evaluated

msg

the message to return if an error occurs

verbose

wether or not to return to expression producing the error

silent

wether or not the error should be kept under silence

Examples

1
2
3
4
## Not run: 
attempt(log("a"), msg = "Nop !")

## End(Not run)

attempt documentation built on May 4, 2020, 1:05 a.m.