Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

evaluate_promise

Evaluate a promise, capturing all types of output.


Description

Evaluate a promise, capturing all types of output.

Usage

evaluate_promise(code, print = FALSE)

Arguments

code

Code to evaluate.

Value

A list containing

result

The result of the function

output

A string containing all the output from the function

warnings

A character vector containing the text from each warning

messages

A character vector containing the text from each message

Examples

evaluate_promise({
  print("1")
  message("2")
  warning("3")
  4
})

testthat

Unit Testing for R

v3.0.2
MIT + file LICENSE
Authors
Hadley Wickham [aut, cre], RStudio [cph, fnd], R Core team [ctb] (Implementation of utils::recover())
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.