Statistical Modeling and knitr/R Markdown

Christopher Gandrud · 2020

One final note on including makefiles in students’ 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. Placing the makefile first will keep the others up-to-date. Including dynamic code in the body of their R Markdown text is similar to including static code. The only difference is that they put the letter r after the first single backtick. By default, knitr code chunks are run by R, and the code and any text output are inserted into the text of their presentation documents in blocks. Cached chunks are only rerun when their code changes. Sometimes one chunk will depend on the results from a prior chunk. In these cases, it is good to rerun the chunk if the prior chunk one is also rerun.

Read the paper · More papers on PaperTik