← Back to all sparks
E

evaluate

INFRA · APIS
Velocity0.0

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

The engine under every knitted R document reached 1.0 by making evaluation behave like the console.

r-libcode-evaluationknitrgraphics-capturereproducibilityr-package
Current state
evaluate captures the output, plots, messages and conditions produced by running R code, and it is the layer knitr and R Markdown sit on. The 1.0.0 release changed core semantics — multi-expression input now stops at the first error — and gave results a real class. Since then, releases have been graphics-focused: ragg-based capture when available, grid plot fixes, and a patch for ggplot2 4.0.0.
Where it's heading
The package is being tightened rather than expanded. 1.0.0 removed complexity it could not justify, deprecated include_timing, dropped a function testing for an object it never created, and aligned error behaviour with the console; 1.0.4 then moved plot capture toward a faster, more capable device. The recurring theme is reliability of output capture across environments, which is exactly what a document-rendering substrate needs and what local_reproducible_output() exists to enforce.
Prediction
Expect continued fast-follow patches keyed to graphics-stack releases — ggplot2 and ragg in particular — rather than new API surface.

Recent moves

  1. 11mo ago

    Patch for ggplot2 4.0.0 support

    A single-purpose patch to keep plot capture working against ggplot2 4.0.0. Small in text, but it sits on the path of every knitted document that draws a ggplot.

    View source ↗
  2. 1y ago

    Plot capture moves to ragg when available

    evaluate() uses ragg::agg_capture() if ragg is installed, giving faster and more modern graphics than pdf(), and stops opening a device when new_device = FALSE. Cleanup now runs with interrupts suspended, which matters for anyone wrapping evaluation in setTimeout().

    View source ↗
  3. 1y ago

    Fix for rlang::abort() inside evaluate()

    A small fix for a bug that only appeared when rlang::abort() was called inside evaluate(). Follow-up to the condition handling reworked in 1.0.0.

    View source ↗
  4. 1y ago

    1.0 stops at the first error and gives results a class

    ⚡ SPARK

    Multi-expression input now terminates on the first error instead of running on, results gain an evaluate_evaluation class with a print method, and plots created before messages are finally captured correctly. It is the release that decided what evaluate is for and shed what it wasn't.

    View source ↗
  5. 2y ago

    Source handler gains access to the parsed call

    The source output handler can take both the unparsed source and the parsed call, letting callers change what source is displayed. A small hook, aimed at tools that reformat code in rendered output.

    View source ↗