Find us on GitHub

University of Michigan - RMarkdown and Knitr Workshop

Wednesday, May 11th, 2016

12:15pm - 3:15pm Eastern Daylight Time 2024 Dana Building

Instructors: Marian L. Schmidt

Helpers: Jackie Cohen, Arthur Endsley, Akima George

Dynamic Documents with RMarkdown and Knitr

This 3 hour workshop will introduce scientists to creating dynamic documents with RMarkdown and Knitr. Dynamic documents contain both program code and narratives and are useful for writing reproducible analysis reports for publication, sharing work with collaborators, writing up homework, and keeping a bioinformatic notebook. Rmarkdown is a simple formatting syntax for authoring dynamic HTML, PDF, Microsoft Word, Markdown and presentation files.

In this workshop we will go over the basis of knitr code chunk syntax and options, inline code, plotting, tables, caching, ‚Äčand inserting bibliographies. We will focus on rendering HTML files, however, resources for rendering other document types will be provided.

We will assume some experience with R and RStudio, however, people who are new to Rmarkdown and knitr are welcome to attend the workshop.

This workshop is organized by the Data Intensive Biology Training Program run by Dr. C. Titus Brown at the University of California, Davis. Two remote classrooms will participate in addition to the local University of Michigan classroom.

General Information

Software Carpentry's mission is to help scientists and engineers get more research done in less time and with less pain by teaching them basic lab skills for scientific computing. This hands-on workshop will cover basic concepts and tools of dynamic documents with RMarkdown and Knitr. Participants will be encouraged to help one another and to apply what they have learned to their own research problems.

For more information on what we teach and why, please see our paper "Best Practices for Scientific Computing".

Who: The course is aimed at anyone performing quantitative analysis including, undergraduate and graduate students and other researchers. Some experience with R is recommended.

Where: 2024 Dana Building, 440 Church Street, Ann Arbor, MI, USA, 48109. Get directions with OpenStreetMap or Google Maps.

Requirements: Participants must bring a laptop with a Mac, Linux, or Windows operating sytem (not a tablet, Chromebook, etc.) that they have administrative privileges on. They should have a few specific software packages installed (listed below). They are also required to abide by Software Carpentry's Code of Conduct.

Accessibility: We are committed to making this workshop accessible to everybody. The workshop organisers have checked that:

  • The room is wheelchair / scooter accessible.
  • Accessible restrooms are available.

Materials will be provided in advance of the workshop and large-print handouts are available if needed by notifying the organizers in advance. If we can help making learning easier for you (e.g. sign-language interpreters, lactation facilities) please get in touch and we will attempt to provide them.

Contact: Please mail marschmi@umich.edu for more information.


Schedule

Wednesday, May 11th, 2016

12:15 Why dynamic documents with RMarkdown and Knitr?
12:30 Intro to RMarkdown syntax
13:00 Intro to Knitr code chunks and Inline Code
13:45 Break
14:30 Adding Tables and Plots
14:00 Caching and Inserting Bibliographies
15:00 Wrap Up

Etherpad: http://pad.software-carpentry.org/2016-05-11-RMarkdown.
We will use this Etherpad for chatting, taking notes, and sharing URLs and bits of code.


Syllabus

Dynamic Documents with RMarkdown and Knitr

  • Why dynamic documents?
  • Introduction to RMarkdown syntax
  • Introduction to Knitr Code Chunks
  • Inline Code
  • Creating tables and plots
  • Caching
  • Inserting Bibliographies
  • Reference...

Setup

To participate in this workshop, you will need access to the software described below. In addition, you will need an up-to-date web browser.

We maintain a list of common issues that occur during installation as a reference for instructors that may be useful on the Configuration Problems and Solutions wiki page.

R

R is a programming language that is especially powerful for data exploration, visualization, and statistical analysis. To interact with R, we use RStudio.We will be working with the current release of RStudio v0.99.1172, which has both the RMarkdown package and pandoc included.

Windows

Video Tutorial

Install R by downloading and running this .exe file from CRAN. Also, please install the current release of the RStudio IDE v0.99.1172.

Mac OS X

Video Tutorial

Install R by downloading and running this .pkg file from CRAN. Also, please install the current release of the RStudio IDE v0.99.1172.

Linux

You can download the binary files for your distribution from CRAN. Or you can use your package manager (e.g. for Debian/Ubuntu run sudo apt-get install r-base and for Fedora run sudo yum install R). Also, please install the current release of the RStudio IDE v0.99.1172.

Once R and RStudio are installed, please install the Knitr R package by running install.packages("knitr") within R.