try_silent {ao}R Documentation

Try an expression silently.

Description

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

Usage

try_silent(expr)

Arguments

expr

An R expression to try.

Details

This function is a wrapper for try.

Value

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

Examples

try_silent(log(1))
try_silent(log("1"))

[Package ao version 0.2.1 Index]