eng_python {reticulate}R Documentation

A reticulate Engine for Knitr

Description

This provides a reticulate engine for knitr, suitable for usage when attempting to render Python chunks. Using this engine allows for shared state between Python chunks in a document – that is, variables defined by one Python chunk can be used by later Python chunks.

Usage

eng_python(options)

Arguments

options

Chunk options, as provided by knitr during chunk execution.

Details

The engine can be activated by setting (for example)

knitr::knit_engines$set(python = reticulate::eng_python)

Typically, this will be set within a document's setup chunk, or by the environment requesting that Python chunks be processed by this engine. Note that knitr (since version 1.18) will use the reticulate engine by default when executing Python chunks within an R Markdown document.

Supported knitr chunk options

For most options, reticulate's python engine behaves the same as the default R engine included in knitr, but they might not support all the same features. Options in italic are equivalent to knitr, but with modified behavior.

Python engine only options


[Package reticulate version 1.38.0 Index]