Teaching > R Course > Home

Course materials for teaching R

This site contains course materials for teaching and learning R. The initial version of this course is a one-day seminar at Aarhus University on November 14, 2013 for faculty and PhD students of the Department of Political Science and Government.s

There is an ever increasing library of online tutorials, books, and other resources for learning R. So why create something new? Unlike the books or other tutorials, the idea behind this course is to create an ever-increasing library of short resources that allow students to quickly grasp one small facet of R programming. The course is therefore structured around small R scripts, which students can read and run on their own, in order to both learn R and simultaneously observe good reproducible research practice.

By breaking up learning R into a large number of small pieces, the materials here will become a modular set of tools that can be used by courses of different sizes, levels, lengths, and objectives without having to change to a different text or combine parts of multiple texts to teach the intended material.

Course Outline

I’ve posted a Course Outline that describes the course outline and schedule. Slides for each part of the course are posted on the Course Outline, as well.

Tutorial Scripts

The scripts page lists the various tutorial scripts that I’ve produced for the course. HTML versions of the scripts can be seen at the Tutorials page.

These scripts are fully executable, meaning they can be copied into the R console, run through a script editor (like rite) or IDE (like RStudio), or executed on the command line using RScript.

They are also written in roxygen-style so that they can be directly converted to Rmarkdown and HTML using knitr::spin.

Specifically, the following code (run from the root directory of this repository, which you can download as a .zip) will convert all of the scripts to Rmarkdown and to HTML, allowing them to be viewed directly in a web browser:

setwd('./Scripts')

sapply(dir(pattern='.r$'), knitr::spin)

R Resources

I’ve posted an up-to-date list of resources that will be useful for getting started with and becoming more sophisticated with R.

Why GitHub?

Read more about why this course is on GitHub here. You can access the GitHub repository here.