chunk-callbacks: Register and Unregister a Chunk Callback

chunk-callbacksR Documentation

Register and Unregister a Chunk Callback

Description

Register a callback function to be executed after a chunk within an R Markdown document is run.

Usage

registerChunkCallback(callback)

unregisterChunkCallback(id = NULL)

Arguments

callback

A callback function. See Chunk Callbacks for more details.

id

A unique identifier.

Value

For registerChunkCallback(), a unique identifier. That identifier can be passed to unreigsterChunkCallback() to de-register a previously-registered callback.

Chunk Callbacks

The callback argument should be a function accepting two parameters:

  • chunkName: The chunk label,

  • chunkCode: The code within the chunk.

The function should return an R list of HTML outputs, to be displayed after that chunk has been executed.


rstudioapi documentation built on Oct. 23, 2024, 1:07 a.m.