View source: R/chapterPreamble.R
| chapterPreamble | R Documentation |
Execute code to set up the compilation environment at the start of every chapter.
chapterPreamble(cache = TRUE)
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, primarily for use of Biocpkg and similar functions.
HTML elements are defined using setupHTML.
HTML is printed to standard output, see setupHTML.
Aaron Lun
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.