Skip to content

This function uses record() internally, but instead of creating an ascii cast, it just returns the output of the code in a character vector.

Usage

record_output(
  script,
  echo = FALSE,
  prompt = echo,
  stdout = TRUE,
  stderr = TRUE,
  ...
)

Arguments

script

The code to record, passed to record().

echo

Whether to include the input in the return value.

prompt

Whether to include the R prompt in the return value.

stdout

Whether to include the standard output in the return value.

stderr

Whether to include the standard error in the return value.

...

Addiitonal arguments are passed to record(). (You cannot use typing_speed and echo, though, because these are used internally by record_output().

Value

Character vector of output (plus input if echo, plus prompt if prompt), as it would appear on a terminal.

See record() for additional options.