Skip to contents

This function tries to execute expr and returns a string with the error message if the execution failed.

Usage

try_silent(expr)

Arguments

expr

[expression]
An R expression to be evaluated.

Value

Either the value of expr or in case of a failure an object of class fail, which contains the error message.

Details

This function is a wrapper for try.

See also

Examples

if (FALSE) { # \dontrun{
try_silent(1 + 1)
try_silent(1 + "1")
} # }