File: README.md

package info (click to toggle)
r-cran-evaluate 1.0.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 436 kB
  • sloc: sh: 13; makefile: 2
file content (30 lines) | stat: -rw-r--r-- 1,618 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# evaluate

<!-- badges: start -->
[![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)
<!-- badges: end -->

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.