Usage with R Markdown documents
#
Embed a sketch R file in an R Markdown documentSuppose the sketch R file is sketch.R
, then it can be embedded in an
RMD file using sketch::insert_sketch
in a code chunk. This is
particularly useful when you have a large application.
#
Use the sketch knitr enginesketch now has a knitr engine! To use it,
- include
knitr::knit_engines$set(sketch = sketch::eng_sketch)
in the setup code chunk, and then - use
```{sketch}```
in place of```{r}```
.
Concretely, the code chunks
will produce
The engine supports the following options:
rules
,deparsers
to pass on tosource_r
,debug
,asset_tags
to pass on tocompile_r
, andstyle
for styling the iframe, e.g.,style = "width: 100%; border: none;"
is a common option to use.