Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/r-lib/evaluate
A version of eval for R that returns more information about what happened
https://github.com/r-lib/evaluate
evaluation parsing r r-package repl
Last synced: 2 days ago
JSON representation
A version of eval for R that returns more information about what happened
- Host: GitHub
- URL: https://github.com/r-lib/evaluate
- Owner: r-lib
- License: other
- Created: 2008-05-18T13:40:10.000Z (over 16 years ago)
- Default Branch: main
- Last Pushed: 2024-12-20T14:50:46.000Z (22 days ago)
- Last Synced: 2025-01-03T00:04:41.026Z (9 days ago)
- Topics: evaluation, parsing, r, r-package, repl
- Language: R
- Homepage: http://evaluate.r-lib.org/
- Size: 1.78 MB
- Stars: 133
- Watchers: 13
- Forks: 35
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: NEWS.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
- jimsghstars - r-lib/evaluate - A version of eval for R that returns more information about what happened (R)
README
# evaluate
[![R-CMD-check](https://github.com/r-lib/evaluate/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/r-lib/evaluate/actions/workflows/R-CMD-check.yaml)
[![CRAN status](https://www.r-pkg.org/badges/version/evaluate)](https://CRAN.R-project.org/package=evaluate)
[![Downloads from the RStudio CRAN mirror](https://cranlogs.r-pkg.org/badges/evaluate)](https://cran.r-project.org/package=evaluate)
[![Codecov test coverage](https://codecov.io/gh/r-lib/evaluate/branch/main/graph/badge.svg)](https://app.codecov.io/gh/r-lib/evaluate?branch=main)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.```R
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.