Reproducible Research Course by Eric C. Anderson for (NOAA/SWFSC)


Assignment 0

Due October 7, 2014

These are the things that you should do before the first meeting of the course to prepare your laptop (which you must bring to the course) with the necessary software. Please don’t plan to download this software in the conference room! The wireless network there connects to a pretty small pipe, so we can’t have everyone downloading things at the same time.

Overview

I want everyone to:

  1. Install R (please have R >= 3.1.0)
  2. Install Rstudio (please install the latest version)
  3. Install Git (it is worth getting the most recent version)

Below I have explicit instructions for Macs and PC’s.

Instructions on a Mac

Install R

I would like everyone to be running R version 3.1.0 (2014-04-10) or later. If you have that already, great. If not, download the latest version from http://cran.us.r-project.org/ Click on the Download R for (Mac) OS X link on that page and choose the R-3.1.1-snowleopard.pkg link if you don’t have the Mavericks operating system and R-3.1.1-mavericks.pkg if you do. Install it. Default settings are fine. Here are some more clues though:

  • If you had an earier version of R, and you want to keep that around—which can be a good thing to do if some packages you need don’t work on earier version of R—you can keep the old version around by typing pkgutil --forget ... (where the ... has to be replaced with text appropriate to your situation) in the Terminal before installing. Read the Important Information on the first installer page.)
  • You may as well install it for all users of your laptop so long as you have admin privileges.

Install Rstudio

  1. Go to http://www.rstudio.com/
  2. Click on the big Download RStudio button.
  3. Click on the Desktop version. 1 On the next page click Download Rstudio Desktop
  4. Under Installers for All Platforms get the appropriate one for yourself (i.e. Mac OS X 10.6+ 64-bit).
  5. Open the downloaded file. It should open into a Finder window. Drag the RStudio.app icon into the alias to the Applications folder that is in that finder window. If you have an early version of RStudio it might ask you to confirm that you want to overwrite it with this new one. That is usually fine.

You can now use RStudio. However, we ought to go get git as well

Install git

  1. Open the Terminal application. (You can find this inside the Utilities folder inside the Applications folder.)
  2. In side the command line window that Terminal gives you, type git and hit Return.
  3. If you have git you will get something that start with something like this: usage: git [--version] [--help] [-C <path>] [-c name=value] ...
  4. However, if you don’t have git, that means you don’t have Apple’s Developer tools. Things now start to get operating system-dependent.
    • If you are using the Mavericks (10.9) operating system, Apple will detect this and will pop a window saying “The git command requires the command line developer tools..” At this juncture click on the pop-up window’s Install button to get the developer tools. This will download a lot of stuff and then install it.
      1. Once it is done downloading and installing, you should be able to type git (+ return) in the Terminal window and get a usage message back from git.
      2. After that, you should restart RStudio so it can look for git and know that it is installed on the system.
    • Something similar to the above might happen if you have OS X 10.8 (Mountain Lion), but I don’t know. If you don’t get a little pop-up when you type git at the terminal, then you should follow the directions for OS X 10.7 below.
    • If you have OS X 10.7 (Lion) or below (down to 10.6.8) you can get a git installer, but it appear that you have to use an older version of git than today’s 2.0 git. That will probably be OK. Here is what you should do:
      1. Download the installer from https://code.google.com/p/git-osx-installer/downloads/detail?name=git-1.8.4.2-intel-universal-snow-leopard.dmg
      2. Follow the instructions and do a standard default install.
      3. Now, you should be able to type git (+ return) in the Terminal window and get a usage message back from git.
      4. After that, you should restart RStudio so it can look for git and know that it is installed on the system.

Instructions on a PC

I don’t have a PC, so I am doing this on a fresh instance of a MS 2012 Server on Amazon’s elastic compute cluster.

Install R

  1. From http://cran.us.r-project.org/ click on Download R for Windows.
  2. On the next page click on the base link, and on the next page the Download R 3.1.1 for Windows link.
  3. Run the installer. Click Next on everthing to accept the defaults.

Once that is done you want to go back one page in your browser and then

  1. click on the Rtools link. (We will end up using these to build our own packages, and also to build other people’s packages.)
  2. Click on the Rtools31.exe link.
  3. Run the Rtools installer and choose the default settings. (Note if you already have Cygwin you need to do something different than the default. If you already have Cygwin, though, you don’t need any handholding…)

Install RStudio

  1. Go to http://www.rstudio.com/
  2. Click on the big Download RStudio button.
  3. Click on the Desktop version. 1 On the next page click Download Rstudio Desktop
  4. Under Installers for All Platforms get the appropriate one for yourself (i.e. Windows) and run the installer.
  5. You can choose all the defaults.

You can now use RStudio. However, we ought to go get git as well

Install git

  1. Go to http://msysgit.github.io/
  2. Under where it says “we bring the awesome Git SCM to Windows” Hit the Download button.
  3. Run the installer. The default choices appear to be best. Go ahead and use them unless you know what you are doing. In particular, I think you should stick with using Git Bash as the shell.

That should install fine. When you are done. Re-launch RStudio and see if it has detected git on the system.

  1. In the RStudio menu select Tools -> Global Options and on the bottom select Git/SVN.
  2. If it says (Not Found) under Git executable then browse for it. On my PC it was installed into Program Files (x86)/Git/bin/git.exe. Go ahead and choose that.
  • after that you might have to hit Apply and then OK rather than just OK. You might also need to restart RStudio.

Instructions on Linux

If you are using Linux I will assume you can figure this all out. sudo apt get git, etc.


comments powered by Disqus