Description Usage Arguments Details Author(s) References See Also Examples
View source: R/hook_figasaur.R
As plots are generated in a knitr
document, encode the code used
to produce them into the resulting PNG files. This can be done by
setting the chunk option: figasaur = TRUE
after setting
knit_hooks$set(figasaur = hook_figasaur)
at the top of your
knitr
document. The knitr_example.Rmd
file included in this
package shows a simple example.
1 | hook_figasaur(before, options, envir)
|
before, options, envir |
Arguments as required by knitr; please see references for details |
Note that this only works for PNG files generated for HTML
documents, though it does work when the PNGs are embedded in the
HTML file (e.g. using the self_contained
option in
rmarkdown::render. See knitr::opts_hooks for more information.
David L Miller
https://yihui.name/knitr/hooks#chunk_hooks
encode
1 2 | writeLines(readLines(
system.file("knitr_example.Rmd", package = "stegasaur")))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.