Installing and exploring R with swirl

swirl is an interactive learning tool that works inside RStudio. I recommend swirl exercises for all R users, but especially for students who have never used a command script with a software analysis program before.

Install the swirl package inside RStudio. You are now ready to install the swirl package in RStudio. A package is a small program that runs inside R/RStudio. Follow the steps below.

Launch or open RStudio. In the “Console” after the > type:

install.packages(“swirl”)

It should look like this:

screenshot of RStudio
Screenshot of RStudio interface

Launch the swirl package inside RStudio by typing in the Console:

library(swirl)

swirl()

If you choose Option 1. R Programming, you should see these options in the Console

swirl R Programming menu options

For our class, I recommend completing the following units:

  • Week 1: 1 – 4
  • Week 2: 5 – 9
  • Week 3: 12-14

If you get stuck, you can always type info() to get a list of additional commands, as illustrated below:

After you are done with a session, type

bye()

You can then either exit RStudio or continue your data analysis.

This entry was posted in Uncategorized. Bookmark the permalink. Comments are closed, but you can leave a trackback: Trackback URL.