Knitting Statistics Notes: Creating Teaching Materials with Data Analysis Code and Results Embedded

Nicola F. Reeve · MSOR Connections · 2017

R is a widely used, free, open source software package for data analysis and graphics. Along with core functionality, there are many additional packages to enable specialist usage. One of these packages ‘knitr' allows the integration of R and LaTeX code. This means that code, output and narrative are all included in one source document. Output is generated automatically from the code. If any changes are made to the data, all output is updated automatically. From a teaching perspective, this is particularly useful if you want to create notes with various graphs, statistics etc and you also want to provide the code that shows the student how to do this analysis in R. It is possible to hide either the code or the output. For example, if you are making introduction to statistics worksheets for non-statistics students, you might not want to include R code. If you are including exercises for students, you might not want to include the output and instead have them answer some questions. You can also set these options globally then by changing one option, create two versions of the document - one with solutions, one without, just from one source document.

Read the paper · More papers on PaperTik