What is swirl?

Swirl is an R package that turns the R console into an interactive learning evironment. Students are guided through R programming exercises where they can answer questions in the R console. There is no separation between where a student learns to use R, and where they go on to use R for thier own creative purposes. If you’ve never used swirl before we recommend demoing it first so you can see what we mean. You can find instructions about how to set up swirl at http://swirlstats.com.

What is a swirl course?

A swirl course is a directory that contains all of the files, folders, and lessons associated with the course you are developing. Lessons contain most of the content that students interact with, and the course sequentially organizes these lessons. A course should conceptually encapsulate a broad concept that you want to teach. For example: “Plotting in R” or “Statistics for Engineers” are broad enough topics that they could be broken down further (into lessons which we’ll talk about next). When a student start swirl, they will prompted to choose from a list of courses, and then they can choose a lesson within the course they selected. Once the student selects a lesson, swirl will start asking the student questions in the R console. After the student has completed a lesson they will be presented with a list of courses again.

What is a lesson?

A lesson is a directory that contains all of the files required to execute one unit of instruction inside of swirl. For example a “Plotting in R” course might contain the lessons: “Plotting with Base Graphics”, “Plotting with Lattice”, and “Plotting with ggplot2.” Every lesson must contain one lesson.yaml file which structures the text that the student will see inside the R console while they are using swirl. The lesson.yaml file contains a sequence of questions and the primary utility of swirlify is to help course authors when writing these questions.

How do I get started writing swirl courses?

The swirlify packages was designed to be used with RStudio, which is a computer program designed to help R programmers write code more efficiently. RStudio allows you to have a text editor and an R console open in the same window, which we find is the ideal setup for writing a swirl course.