decorate_chunk: Builds a 'with_flair' object from a code chunk

Description Usage Arguments Details Value

View source: R/decorate_chunk.R

Description

This function reads the source code from a given named code chunk; i.e., {r chunk_name, echo = FALSE}.

Usage

1
decorate_chunk(chunk_name, eval = TRUE, echo = TRUE, include = TRUE, ...)

Arguments

chunk_name

The label name of the chunk we plan to add flair to.

eval

Evaluation options for chunk; behaves identically to ordinary knitr code chunk option eval

echo

Evaluation options for chunk; behaves identically to ordinary knitr code chunk option echo

include

Evaluation options for chunk; behaves identically to ordinary knitr code chunk option include

...

Any number of other chunk options to override.

Details

When run directly in a source file, decorate_chunk() reads the text of the active file and extracts the relevant string of source code from the chosen chunk. (Important: this only works in RStudio.)

When run during the knitr::knit() process, decorate_chunk() pulls the relevant chunk source during knitr::knit_hooks$set("source").

Value

An object of class with_flair


flair documentation built on April 24, 2020, 1:06 a.m.