Literate Programming in R

Let us change our traditional attitude to the construction of programs: Instead of imagining that our main task is to instruct a computer what to do, let us concentrate rather on explaining to human beings what we want a computer to do. – Donald Knuth, Literate Programming (1984)

This workshop will introduce to literate programming concepts and the application of widely used open source components in the R programming language. We’ll create a “compilable” document containing text and bibliography, as well as all the code needed to create the graphs and tables. We’ll demonstrate how the process facilitates making revisions when data changes or in response to reviewer recommendation and the ease with which work can be shared pre or post publication.

Prerequisites

  1. Follow the instructions on the setup page to get the tools you need for the workshop.
  2. No previous R experience required, but, time permitting, please familiarize yourself with some of the basic syntax and structure of R by either taking the free online R course from datacamp.com by learning R from within R with a tutorial called Swirl (instructions here: http://swirlstats.com/students.html). 3.Email tdennis@library.ucla.edu if you run into setup snags .
  3. Download files and data for this class.

Schedule

Setup Download files required for the lesson
00:00 1. Documenting data manipulation How should we manipulate data?
00:40 2. Literate programming What tools are available to easily disseminate our work?
How can we make our work more reproducible?
01:20 3. Explore a working knitr document How does it all come together?
What reseources exist?
02:00 4. Adding citations to your R Markdown manuscript How do I add citations to my RMarkdown document?
How can I integrate Zotero citations into my RMarkdown document?
02:45 5. Exploring a complete knitr document How do I create formatting that markdown doesn’t handle?
How do I integrate git and GitHub into my knitr workflow?
03:25 Finish

The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.