View source: R/decorate_chunk.R
decorate_chunk | R Documentation |
decorated
object from a code chunkThis 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. |
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").
An object of class decorated
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.