ABSTRACT

For a relatively short piece of code that the reader don’t need to run in multiple presentation documents it may be simplest to type the code directly into chunks written in the knitr markup document. By default, knitr code chunks are run by R, and the code and any text output are inserted into the text of the presentation documents in blocks. The numbers in the vector tell knitr which expressions in the chunk to evaluate. The knitr syntax for including inline code is different for the LaTeX and Markdown languages. Perhaps a better way to run makefiles from knitr presentation documents is to include the commands in a code chunk using the Bash engine. One final note on including makefiles in the knitr presentation document source code: it is important to place the code chunk with the makefile before code chunks containing statistical analyses that depend on the data file it creates.