Skip to content

Instantly share code, notes, and snippets.

@riordan
Last active September 20, 2016 18:36
Show Gist options
  • Save riordan/bd5d9693e9aad0b679e9e606ce450fed to your computer and use it in GitHub Desktop.
Save riordan/bd5d9693e9aad0b679e9e606ce450fed to your computer and use it in GitHub Desktop.

Prerequisites: Installing R + RStudio

Brown Institute Transparency Workshop with Harry Enten & Neil Paine of 538 (9/24/16)

To participate in the workshop, you'll have to install some software on your computer prior to the workshop. It'll probably take about a half hour to get everything set up.

These instructions cover installation for Mac OS and Windows. If you're a Linux user, you have my admiration and esteem and can probably figure this out for yourself (be sure to install the plugins).

If you have any issues with this, don't hesitate to contact David Riordan, Rosalie Yu, or Michael Krisch for assistance.

Overview

This tutorial will walk you through the installation of the following pieces of software:

  • The R Programming Language
  • RStudio - a powerful user interface that makes it easier to work with the R Programming Language
  • The following plugins for R
    • Tidyverse - a whole suite of tools for R that do everything from give graphics a grammar (seriously), all the way to giving you tools to simplify data scraping.
    • Clipr - for working with the clipboard
    • Plotly - for working with the charting service Plotly

This will take place over 2 steps:

  1. Installing R + RStudio, which is slightly different in OSX than Windows
  2. Installing the plugins, which we will use RStudio for, making installation nearly identical

Part 1 Installing R + RStudio

For Apple Macintosh OS X

The following written instructions are from the UT Austin Foundations of Data Analysis Course. If you would prefer, MarinStatsLectures has a video tutorial which covers the same material.

Once this is complete, be sure to jump ahead for instructions on installing the required plugins.

1.1 Install R Programming Language

  1. Open an internet browser and go to www.r-project.org.
  2. Click the "download R" link in the middle of the page under "Getting Started."
  3. Select a CRAN location (a mirror site) and click the corresponding link.
  4. Click on the "Download R for (Mac) OS X" link at the top of the page.
  5. Click on the file containing the latest version of R under "Files."
  6. Save the .pkg file, double-click it to open, and follow the installation instructions.

Now that R is installed, you need to download and install RStudio.

1.2 Install RStudio user interface

  1. Go to www.rstudio.com and click on the "Download RStudio" button.
  2. Click on "Download RStudio Desktop."
  3. Click on the version recommended for your system, or the latest Mac version, save the .dmg file on your computer, double-click it to open, and then drag and drop it to your applications folder.

Once this is complete, be sure to jump ahead for instructions on installing the required plugins.

For Windows

The following written instructions are from the UT Austin Foundations of Data Analysis Course. If you would prefer, OpenIntro has a particularly good video tutorial that covers the same instructions.

Install R Programming Language

  1. Open an internet browser and go to www.r-project.org.
  2. Click the "download R" link in the middle of the page under "Getting Started."
  3. Select a CRAN location (a mirror site) and click the corresponding link.
  4. Click on the "Download R for Windows" link at the top of the page.
  5. Click on the "install R for the first time" link at the top of the page.
  6. Click "Download R for Windows" and save the executable file somewhere on your computer. Run the .exe file and follow the installation instructions.

Now that R is installed, you need to download and install RStudio.

Install RStudio user interface

  1. Go to www.rstudio.com and click on the "Download RStudio" button.
  2. Click on "Download RStudio Desktop."
  3. Click on the version recommended for your system, or the latest Windows version, and save the executable file. Run the .exe file and follow the installation instructions.

Once this is complete, be sure to jump ahead for instructions on installing the required plugins.

For Everyone: Installing Plugins

  1. Launch RStudio
  2. In the top menubar click TOOLS -> Install Packages
  3. type that you want to install tidyverse, clipr, plotly. NOTE: Mac OSX may try to use autocorrect on these. Edit those autocorrect edits
  4. Click the INSTALL button and wait for all the plugins to install. Your computer will look like it's very busy. It's going to take a while (10-15 minutes) so consider making a cup of coffee.

Installing plugins in RStudio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment