evaluate v0.14


Monthly downloads



Parsing and Evaluation Tools that Provide More Details than the Default

Parsing and evaluation tools that make it easy to recreate the command line behaviour of R.



Build Status Downloads from the RStudio CRAN mirror

Evaluate provides tools that allow you to recreate the parsing, evaluation and display of R code, with enough information that you can accurately recreate what happens at the command line. Evaluate + replay works very similarly to source(), but is written in such a way to make it easy to adapt for other output formats, such as html or latex.

There are three components to the evaluate package:

  • parse_all, a version of parse that keeps expressions with their original source code, maintaining formatting and comments.
  • evaluate, which evaluates each expression produced by parse_all, tracking all output, messages, warnings, and errors as their occur, and interleaving them in the correct order with the original source and value of the expression.
  • replay, which outputs these pieces in a way that makes it look like you've entered the code at the command line. This function also serves as a template for other output formats.

Functions in evaluate

Name Description
line_prompt Line prompt.
remove_hooks Remove hooks.
set_hooks Set hooks.
replay Replay a list of evaluated results.
try_capture_stack Try, capturing stack on error.
flush_console An emulation of flush.console() in evaluate()
inject_funs Inject functions into the environment of evaluate()
watchout Watch for changes in output, text and graphical.
is.message Object class tests
new_output_handler Custom output handlers.
parse_all Parse, retaining comments.
create_traceback Generate a traceback from a list of calls.
evaluate Evaluate input and return all details of evaluation.
No Results!

Last month downloads


Type Package
License MIT + file LICENSE
URL https://github.com/r-lib/evaluate
BugReports https://github.com/r-lib/evaluate/issues
RoxygenNote 6.1.1
Encoding UTF-8
NeedsCompilation no
Packaged 2019-05-28 15:30:02 UTC; yihui
Repository CRAN
Date/Publication 2019-05-28 15:50:02 UTC

Include our badge in your README