Live from the Roasterie: Today's Holy War Reading
Liveblogging World War II: February 8, 1945: Yalta

RStudio in the Cloud, for Dummies: Teaching: Tools

NewImage

So how cheap does this make all of the hardware and software needed for all the econometrics and dynamic modeling I might ever ask an undergraduate to do in a class?

Ken Kleiman: RStudio in the Cloud, for Dummies:

You can have your own cloud computing version of R, complete with RStudio. Why should you? It's cool! Plus, there's a lot more power out there than you can easily get on your own hardware. And, it's R in a web page. Run it from your tablet. Run it from work, even if you're not supposed to install software. Run it from your boyfriend's laptop while he's on a beer run.... Louis Alsett... doctoral work at Trinity College, University of Dublin. We had thought that running a cloud compute application was beyond our current technical abilities, but Louis' work makes it pretty easy to do....

  1. Get an account with Amazon Web Services (AWS)... not a big deal... a "free tier" which means that you start with 750 hours of usage per month for a year.

  2. Go to this handy page http://www.louisaslett.com/RStudio_AMI/ maintained by Louis. Click on the 32-bit link for your region....

  3. The shortcut from Louis' page brings you through the first steps of setting up. You'll next see a page in the "Request Instances Wizard".... It's effectively a computer in the cloud. The defaults on the wizard are fine, with one key exception....
     
    a. Click Continue on that first page....
    b. On the "Instance details" page, you can also click continue....(The defaults are fine.)
    c. The next page is also "Instance details" and you can click through.
    d. The next "Instance details" page lets you assign a name to the instance. This can be useful if you end up running several instances at the same time, but you can click through for now.
    e. Click through the "Create Key Pair" page; this is also convenient if you're a heavy user, but not necessary.
     
    f. The next step is to "Configure Firewall". This is where you do have to pay attention. Since you'll want to access your virtual machine via a browser, you need to allow HTTP access. To do this: (1) click "Create a New Security Group". (2) Give a name (like "RStudio") and (3) a description ("RStudio")-- both are required. Then, (4) in the "Port range" window, type 80. (Leave the source at 0.0.0.0/0, which means that you can connect from any IP address.) (5) Click "Add Rule". You should get a little blue box describing the rule. Now (6) click continue. On the following page, click "Back" and check that your new security group is selected.
     
    g. Click "Launch". Your virtual machine is being started! There's a page with some links, which you can "Close".

  4. To use the new computer, click "Instances" on the "Navigation" panel of the AWS Management Console Amazon EC2 page. You'll see a row with an "empty" Name, and a State that is either "Pending" or "Running". (You might need to click refresh to see when it starts running.) When it's running, click on it. You get a bunch of information in the box below.

  5. Scroll down to "Public DNS". Copy the DNS and paste it into the address bar in your browser. If all went well, you should see an RStudio login window....

  6. For security, it makes sense to change your password.... Just change the "Password" in the "Welcome.r" file, then source it. You should probably avoid saving the "Welcome.r" file--maybe just close it-- because saving it will result in your password being saved as plain text. Probably not a big risk, but why tempt fate?

  7. You can close your browser and open the window again any time you like, from any browser you like, using your new password.

There's your R in the cloud! Use RStudio's built-in package installation tools to easily build your working environment...


Comments