try_w: Enhanced try that can treat some warnings as errors

Description Usage Arguments Value Author(s)

View source: R/00.Miscellaneous.R

Description

Behaves like try to return try-error object on an error. If a warning is encountered it is checked against the specified regular expression regexp. If the warning message matches the regular expression, it is handled as an error and return try-error object.

Usage

1
try_w(expr, regexp = NULL, silent = FALSE)

Arguments

expr

expression to be evaluated that may give an warning or error.

regexp

regular expression to specify warning to be handled as an error.

silent

whether to silence error/warning messages.

Value

try-error object if an error or a specified warning is encountered. Otherwise, the result of evaluation returns.

Author(s)

Kazuki Yoshida


kaz-yos/distributed documentation built on May 27, 2019, 4:50 a.m.