knitr (version 1.24)

cache_engines: Cache engines of other languages

Description

This object controls how to load cached environments from languages other than R (when the chunk option engine is not 'R'). Each component in this object is a function that takes the current path to the chunk cache and loads it into the language environment.

Usage

cache_engines

Arguments

Format

An object of class list of length 5.

Details

The cache engine function has one argument options, a list containing all chunk options. Note that options$hash is the path to the current chunk cache with the chunk's hash, but without any file extension, and the language engine may write a cache database to this path (with an extension).

The cache engine function should load the cache environment and should know the extension appropriate for the language.

References

See https://github.com/rstudio/reticulate/pull/167 for an implementation of a cache engine for Python.