attempt {attempt}R Documentation

Attempt

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

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

## Not run: 
attempt(log("a"), msg = "Nop !")

## End(Not run)

[Package attempt version 0.3.1 Index]