Learn R Programming

testthat (version 3.1.10)

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)

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

Arguments

code

Code to evaluate.

Examples

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

Run the code above in your browser using DataLab