A great idea: R Markdown for Undergrads

A recently published paper by Baumer et al (2014) caught my eye today (HT to Bruce Caron).  I wanted to share it here because I thought it was cool and also had a few comments to make about some of the issues the authors raised.

First, a bit about the paper.  Partly in response to all the media attention to the crisis in reproducibility in science (e.g. Nature) Baumer and colleagues made some changes to introductory statistics classes at Duke, Smith, and Amherst.  The primary change was to require the use of R Markdown for all homework.  RStudio was the editor they used and it appears any cutting and pasting of code, figures, etc. was not allowed.  They conducted a survey of the students early in the class and after the class.  The end result was that students preferred using R Markdown over the typical mode of cut and paste.  They may have grumbled a bit about learning R Markdown but the benefits were obvious to them.

Getting these students using R Markdown and creating reproducible homework assignments is a fantastic thing, in my opinion.  I have worked with younger researchers (although not undegrads) and with older ones.  Convincing younger researchers of the benefits of R Markdown and the general concept of reproducibility is pretty easy.  To put it bluntly, the older researchers are a pain…  There are ALWAYS long conversations (er, arguments) about why their method is not any different than a reproducible one, why their method it is better, etc.  I suppose the “old dog, new tricks” is apropos.  The moral of the story is that teaching undergrads reproducibility and Open Science in general will have many long term benefits and what Baumer and colleagues have done should be more widely adopted.

Aside from my being a big fan of what they did, I have one response to an issue they raised in the paper.  On pages 16-17 the authors discuss the need to collaborate on R Markdown documents and suggest Dropbox as a possible solution. While that might work, I think a better option is to use Git and Github.  This is, I think a great opportunity to introduce version control early on to the students and it fits right inline with the open science and reproducibility theme of the authors efforts.

So in short, what Baumer and colleagues are doing is great. It would be FANTASTIC if they added Git/Github to the mix.

9 thoughts on “A great idea: R Markdown for Undergrads

  1. Pingback: Momento R do Dia | De Gustibus Non Est Disputandum

  2. Pingback: A great idea: R Markdown for Undergrads ← Patient 2 Earn

  3. Phillip Burger

    This encouraging to see for the reasons you mention. Other concepts helpful to the students would naturally evolve from using Markdown. For example, setting the value of a seed as it relates to reproducility. And, using the R project structure rather than mashing all resources into one directory.

    1. jeffwhollister Post author


      I agree. A lot of what was implemented in RStudio is good practice and it make a great deal of sense to use that to help with teaching. A lot of good things can certainly come from the efforts of those like Baumer et al.


  4. Joyce Faler

    Just to let you know, as an “older” researcher who started using R through Coursera courses in 2013, you would get no argument from me about the benefits of using R. I am totally psyched about using R and R Markdown and hope to implement it in our qPCR and microarray analyses. Next stop for me is learning to use Git and Github, probably also through Coursera courses.

    1. jeffwhollister Post author

      Joyce, thanks for the comment. I probably should have been a bit more clear in my statement. Many ”older”(I include myself in that category too) researchers are excited about new things and especially R and R Markdown, which is great. That being said our cohort is almost exclusively the source of push back.

      As for Git and Github, there are a number of good ways to start to pick it up. Using RStudio as a Git GUI worked,well for me. Also Github has a lot of great resources at http://help.github.com and http://training.github.com. Lastly, if you get the chance, Software Carpentry boot camps are another good way to start learning Git. More info at http://software-carpentry.org.

  5. davgar


    I think writing cooperative documents with Dropbox is a No NO! It is not designed for that and will just duplicate files saved while open. Good for distributing or reporting back with.

    Mecurial is another option which has great GUIs available.

    Interestingly there is a diffing markup for MD called critic markup and some tools support diff-ing MD files with it. (eg MultiMarkdown Composer), That would be a way to go.

    1. jeffwhollister Post author

      I agree that a version control solution would be the way to go for the collaborative writing. I will have to take a look at MultiMarkdown Composer, although I would bet that the authors of the paper would be reluctant to add another tool. The nice thing about Git, Github and RStudio is that they are already well integrated so the students wouldn’t need to pick up another interface.

      Also, Github recently started rendering diffs in prose, ala track-changes in Word. Bit more about that at https://github.com/blog/1784-rendered-prose-diffs

Comments are closed.