Skip to content
/ evaluate Public

A version of eval for R that returns more information about what happened

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

r-lib/evaluate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Aug 21, 2024
8ae1af2 · Aug 21, 2024
Jul 3, 2024
Aug 21, 2024
Aug 21, 2024
Jul 16, 2024
Aug 21, 2024
Jun 10, 2024
Jul 16, 2024
Jul 11, 2024
Mar 21, 2023
Mar 21, 2023
Jul 17, 2024
Aug 21, 2024
May 14, 2024
May 14, 2024
Feb 26, 2021
Jun 10, 2024
Oct 28, 2020

Repository files navigation

evaluate

R-CMD-check CRAN status Downloads from the RStudio CRAN mirror Codecov test coverage

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.

library(evaluate)

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.