attempt: Attempt

View source: R/adverbs.R

attemptR 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 are no errors or messages.

Usage

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

Arguments

expr

the expression to be evaluated

msg

the message to return if an error or warning occurs

verbose

whether to return the expression producing the error

silent

whether the error should be silent

Examples

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

## End(Not run)

ColinFay/trycatchthis documentation built on Dec. 31, 2022, 3:59 a.m.