withWE {rmelting} | R 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")}

[Package rmelting version 1.3.0 Index]