Statistics With Interactive R Learning
Every new tech thing needs a nice acronym and logo
an R package for teaching and learning statistics and R simultaneously and interactively
Lessons are a dialogue between swirl and the user
Responses are evaluated for correctness based on instructor-specified answer tests.
Students work directly in R console = real working environment
Allows immediate evaluation of code and immediate feedback
Allows remote logging of scores so I can check progress
You only need to do this once.
# install swirl. # Requires "" install.packages("swirl")
Lessons are on the intro2r GitHub page
(github = social coding site, sharing code)
You only need to do this once for each Unit (unless we update the lessons … ).
# load the swirl pakcage library(swirl) # access github and download the course # (this function is provided with the swirl package) install_course_github("intro2r", "swirl_courses", multi = TRUE)
This command downloads the first set of lessons to your computer.
You will need to do this every time you start R or want to continue an old lesson or start a new lesson.
# load the swirl package into your current R session # (No need for "") library(swirl) | Hi! Type swirl() when you are ready to begin. # start swirl ... # (swirl is a function, so you need '()') swirl()
> library(swirl) | Welcome to swirl! Please sign in. | If you've been here before, use the same name as you did then. | If you are new, call yourself something unique. What shall I call you?
Enter your name.
I will need to be able to identify you, so please use:
This name will also allow you to continue lessons if you stop them in the middle.
| Please choose a course, or type 0 to exit swirl. 1: Getting Started 2: Take me to the swirl course repository! Selection:
Enter the number of the course you want to work on.
| Please choose a lesson, or type 0 to return to course menu. 1: Basic Building Blocks 2. ... ...
Choose the first lesson: Basic Building Blocks
| Attempting to load lesson dependencies... | Package ‘base64enc’ loaded correctly! | | 0% | In this lesson, we will explore some basic building blocks of the R programming language. ...
Hit ‘Enter’ to advance when presented with ‘…’
The screen also shows you how far through the lesson you are (0%).
You will need to be connected to the internet to submit your lesson
When you are done, the last question will ask if you want to submit your answers to me to verify that your completed the lesson.
You should enter the number of your response (usually ‘1’).
This will bring up a new web page, a Google form.
Scroll down, and click ‘submit’.
This will send an encrypted response to the Google form so that we can verify you completed the lesson.
Leave swirl temporarily and gain access to the console again
Return to swirl after playing
Return to the main menu
Display a list of these special commands