Sheila Braun
1 min read

Swirl: Learn R in R

If you haven’t had a chance to learn anything at all about R and want to, you have a couple of options. You could stop in at the R Lab for Beginners in which Joy Payton walks you through basic R functionality, or if you are a do-it-yourselfer, start here and discover the swirl package.

  1. Download and install R for your system:
  2. Download and install RStudio for your system:
  3. Open RStudio.

  4. Find the console on RStudio. It’s one of the tabs. You should be able to put your cursor to the right of a “>” character. Do so.

  5. Type these three lines, one by one. Give each command time to execute before executing the next one: if you try to execute them all at the same time, they may trip each other up. You may be prompted to allow installation of dependent packages. If so, acquiesce.

    > install.packages("swirl")
    > library(swirl)
    > swirl()

  6. Select 1.

After that, select the lesson you want to learn. If you have never done anything in R, you might want to start with the first lesson in the list.

Should you need them, here are some step-by-step videos to help you through the first few lessons in the Basic R course. They are meant to help you if you are stuck by providing answers and the rationales behind them: