STOR 455 (Cunningham)

Swirl is a useful R package that lets you learn R interactively right in the R Console of R-Studio. As you work through the lessons, you will experience lots of positive affirmations as well. (I am not responsible for these affirmations.)

1. Open R-studio and either type or copy-paste the following script into the Console to load Swirl into R:

(If you are experienced with R, skip whatever you like.)

#Install swirl package (only need to do this once)
install.packages("swirl")

#Load swirl library
library("swirl")

#Install these three swirl courses
install_from_swirl("R_Programming")
install_from_swirl("Getting_and_Cleaning_Data")
install_from_swirl("Exploratory_Data_Analysis")

#Begin swirl
swirl()

R will take a few minutes to load all of the packages, after which you can put in the name you would like to be called. I chose “Captain”, but it doesn’t matter.

2. Choose R Programming once you get to the 4-item menu.

I recommend the following lessons, roughly in order. It is worth mentioning that lesson 2 is a bit of a pain.

Lesson 1 - Basic Building Blocks Lesson 3 - Sequences of Numbers Lesson 4 - Vectors Lesson 6 - Subsetting Vectors Lesson 2 - Workspace and Files (painful) Lesson 5 - Missing Values (optional)

3. After completing lessons 1, 3, 4, 6, give yourself a pat on the back.

Then if you are hungry for more or have computer science experience, go ahead and try Lesson 2. We will eventually have to master some of the topics in Lesson 2, but we’ll pick up much of it as the course goes on.