Description Usage Arguments Details Value
This function reads the source code from a given code chunk that has the value label
set to the demo
option; i.e., {r, demo = "my_label"}
.
1 | demo_chunk(label)
|
label |
String that gives the name of the label used in a chunk option. If left blank, current chunk is used. |
When run directly in a source file, demo_chunk()
reads the text of the active file and extracts the relevant string of source code from the labelled chunk. (Important: this only works in RStudio.)
When run during the knitr::knit()
process, demo_chunk()
pulls the relevant chunk source during knitr::knit_hooks$set("source").
An object of class demo_code
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.