This function reads the source code from a given named code chunk;
i.e., {r chunk_name, echo = FALSE}.
decorate_chunk(chunk_name, eval = TRUE, echo = TRUE, include = TRUE, ...)
| chunk_name | The label name of the chunk we plan to add |
|---|---|
| eval | Evaluation options for chunk;
behaves identically to ordinary |
| echo | Evaluation options for chunk;
behaves identically to ordinary |
| include | Evaluation options for chunk;
behaves identically to ordinary |
| ... | Any number of other chunk options to override. |
An object of class with_flair
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").