Simply Statistics A statistics blog by Rafa Irizarry, Roger Peng, and Jeff Leek

Announcing the Release of swirl 2.0

Editor’s note: This post was written by Nick Carchedi, a Master’s degree student in the Department of Biostatistics at Johns Hopkins. He is working with us to develop the Data Science Specialization as well as software for interactive learning of R and statistics.

Official swirl website: swirlstats.com

On September 27, 2013, I wrote a guest blog post on Simply Statistics to announce the creation of Statistics with Interactive R Learning (swirl), an R package for teaching and learning statistics and R simultaneously and interactively. Over the next several months, I received a tremendous amount of feedback from all over the world. Two things became clear: 1) there were many opportunities for improvement on the original design and 2) there’s an incredible demand globally for new and better ways of learning statistics and R.

In the spirit of R and open source software, I shared the source code for swirl on GitHub. As a result, I quickly came in contact with several very talented individuals, without whom none of what I’m about to share with you would have been possible. Armed with invaluable feedback and encouragement from early adopters of swirl 1.0, my new team and I pursued a complete overhaul of the original design.

Today, I’m happy to announce the result of our efforts: swirl 2.0.

Like the first version of the software, swirl 2.0 guides students through interactive tutorials in the R console on a variety of topics related to statistics and R. The user selects from a menu of courses, each of which is broken up by topic into shorter lessons. Lessons, in turn, are a dialog between swirl and the user and are composed of text output, multiple choice and text-based questions, and (most importantly) questions that require the user to enter actual R code at the prompt. Responses are evaluated for correctness based on instructor-specified answer tests and appropriate feedback is given immediately to the user.

It’s helpful to think of swirl as the synthesis of two separate parts: content and platform. Content is authored by instructors in R Markdown files. The platform is then responsible for delivering this content to the user and interpreting the user’s responses in an interactive and engaging way.

Our primary focus for swirl 2.0 was to build a more robust and extensible platform for delivering content. Here’s a (nontechnical) summary of new and revised features:

  • A library of answer tests an instructor can deploy to check user input for correctness
  • If stuck, a user can skip a question, causing swirl to enter the correct answer on their behalf
  • During a lesson, a user can pause instruction to play around or practice something they just learned, then use a special keyword to regain swirl’s attention when ready to resume
  • swirl “sees” user input the same way R “sees” it, which allows swirl to understand the composition of a user’s input on a much deeper level (thanks, Hadley)
  • User progress is saved between sessions
  • More readable output that adjusts to the width of the user’s display (thanks again, Hadley)
  • Extensible framework allows others to easily extend swirl’s functionality
  • Instructors can author content in a special flavor of R markdown

(For a more technical understanding of swirl’s features and inner workings, we encourage readers to consult our GitHub repository.)

Although improving the platform was our first priority for this release, we’ve made some improvements to existing content and, more importantly, added the beginnings of a new course: Intro to R. Intro to R is our response to the overwhelming demand for a more accessible and interactive way to learn the R language. We’ve included the first three lessons of the course and plan to add many more over the coming months as our focus turns to creating more high quality content.

Our ultimate goal is to have the statistics and R communities use swirl as a platform to deliver their own content to students interactively. We’ve heard from many people who have an interest in creating their own content and we’re working hard to make the process of creating content as simple and enjoyable as possible.

The goal of swirl is not to be flashy, but rather to provide the most authentic learning environment possible. We accomplish this by placing students directly on the R prompt, within the very same environment they’ll use for data analysis when they are not using swirl. We hope you find swirl to be a valuable tool for learning and teaching statistics and R.

It’s important to stress that, as with any new software, we expect there will be bugs. At this point, users should still consider themselves “early adopters”. For bug reports, suggested enhancements, or to learn more about swirl, please visit our website.

Contributors:

Many people have contributed to this project, either directly or indirectly, since its inception. I will attempt to list them all here, in no particular order. I’m sincerely grateful to each and everyone one of you.

  • Bill & Gina: swirl is as much theirs as it is mine at this point. Their contributions are the only reason the project has evolved so much since the release of swirl 1.0.
  • Brian: Challenged me to turn my idea for swirl into a working prototype. Coined the “swirl” acronym. swirl would still be an idea in my head without his encouragement.
  • Jeff: Pushes me to think big picture and provides endless encouragement. Reminds me that a great platform is worthless without great content.
  • Roger: Encouraged me to separate platform and content, a key paradigm that allowed swirl to mature from a messy prototype to something of real value. Introduced me to Git and GitHub.
  • Lauren & Ethan: Helped with development of the earliest instructional content.
  • Ramnath: Provided a model for content authoring via slidify “flavor” of R Markdown.
  • Hadley: Made key suggestions for improvement and provided an important proof of concept. His work has had a profound influence on swirl’s development.
  • Peter: Our discussions led to a better understanding of some key ideas behind swirl 2.0.
  • Sally & Liz: Beta testers and victims of my endless rants during stats tutoring sessions.
  • Kelly: Most talented graphic designer I know and mastermind behind the swirl logo. First line of defense against bad ideas, poor design, and crappy websites. Visit her website.
  • Mom & Dad: Beta testers and my #1 fans overall.