Description Usage Arguments Details Value Author(s) Examples
View source: R/chapterPreamble.R
Execute code to set up the compilation environment at the start of every chapter.
1 | chapterPreamble(cache = FALSE)
|
cache |
Logical indicating whether to cache code chunks. |
Compilation is performed with no tolerance for errors, no printing of package start-up messages, and no printing of warnings.
Numbers are printed to 4 digits of precision.
The BiocStyle package is automatically attached.
HTML elements are defined using setupHTML
.
See setupHTML
.
Aaron Lun
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | tmp <- tempfile(fileext=".Rmd")
write(file=tmp, "```{r, echo=FALSE, results='asis'}
rebook::chapterPreamble()
```
```{r}
pi # four digits!
```
```{r}
warning('ASDASD') # warnings and messages are not saved in the HTML.
```
```{r, results='asis'}
prettySessionInfo()
```")
rmarkdown::render(tmp)
if (interactive()) browseURL(sub(".Rmd$", ".html", tmp))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.