withWE: Evaluate expression and capture all warnings and errors if...

View source: R/withWE.R

withWER Documentation

Evaluate expression and capture all warnings and errors if any along with results

Description

Not exported. Strictly internal

Usage

withWE(expr)

Arguments

expr

The expression to be evaluated.

Value

  • In cas of Warning(s)Returns the value along with the warning message(s).

  • In cas of ErrorReturns NA as the value along with the error message.

Examples

foo <- function(){
  warning("oops")
  1}

foo <- function(){
  warning("oops")
  warning("again oops")
  1}

foo <- function(){
  warning("oops")
  log("a")}


aravind-j/rmelting documentation built on May 16, 2023, 10:47 p.m.