Another Word For It Patrick Durusau on Topic Maps and Semantic Diversity

February 8, 2014

Learn R Interactively with Swirl

Filed under: Programming,R,Statistics — Patrick Durusau @ 4:38 pm

Learn R Interactively with Swirl by Nathan Yau.

I guess R counts as “learning to code.” 😉

If you need more detail than Nathan outlines, consider these from Swirl:

The swirl R package is designed to teach you statistics and R simulateously and interactively. If you are new to R, have no fear. On this page, we’ll walk you through each of the steps required to begin using swirl today!

Step 1: Get R

In order to run swirl, you must have R installed on your computer.

If you need to install R, you can do so here.

For help installing R, check out one of the following videos (courtesy of Roger Peng at Johns Hopkins Biostatistics):

Step 2 (optional): Get RStudio

In addition to R, it’s highly recommended that you install RStudio, which will make your experience with R much more enjoyable.

If you need to install RStudio, you can do so here. You probably want the download located under the heading Recommended For Your System.

Step 3: Get swirl!

Open RStudio (or just plain R if you don’t have RStudio) and type the following into the console:

> install.packages("swirl")

Note that the > symbol at the beginning of the line is R’s prompt for you type something into the console. We include it here so you know that this command is to be typed into the console and not elsewhere. The part you type begins after >.

Step 4: Start swirl and let the fun begin!

This is the only step that you will repeat every time you want to run swirl. First, you will load the package using the library() function. Then you will call the function that starts the magic! Type the following, pressing Enter after each line:

> library("swirl")

> swirl()

And you’re off to the races! Please visit our Help page if you have trouble completing any of these steps.

Other R links:

The R Project Resources and Links.

CRAN – Packages

Swirl

No Comments

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress