R is an industrial strength open-source statistical package. We’ll use it for simulation, computation, and visualization. Don’t worry if you are not familiar with R, we will provide plenty of tutorials and guidance in its use.

R takes 2 minutes to install. Here are the steps:

- Go to the main page of the R project. Click the ‘CRAN’ link on the left. Then choose any of the mirror sites.
- Download and install.
- On a Mac, download the latest version that works for your machine. You double-click to install.
- On Windows, just follow the instructions.
- If you’re using Linux, you should be able to figure out how to install R.

We will also be using RStudio which provides an integrated environment for working in R. It is also a 2-minute install. Here are the steps.

- Go to the Download RStudio page and choose the version for your computer (probably the one “recommended for your system”).
- Download and install.
- On a Mac, open the downloaded .dmg file and copy the RStudio application to your Applications folder.
- On Windows, install from the downloaded .exe.
- If you’re using Linux, you should be able to figure out how to install RStudio.

If you are interested you can find lots of information and tutorials on R from the main page of the R project.

### Tutorials

- R Tutorial A: Basics
- R Tutorial B: Random Numbers
- R Tutorial: Functions (The basics of creating functions)
- Sample Plotting Script (R) (Short script showing basic plotting in R)
- R Tutorial: for Loops (Basics of for loops)
- Sample Histogram Script (R) (Shows the basics of using “hist()")
- Script: Demonstrating “which()” (R) (Used for finding indices)
- Script: Showing Easy Plotting and Shading (R) (Shows how to use the “curve()” and “polygon()” function)
- R Tutorial: Run Length Encoding
- Script: Using colors (R)
- Script: Printing in Math Notation and Symbols (R)

### R Code for Class Slides and Readings

- R Code for Class 6 (R)
- R Code for Class 7 (R)
- R Code that generate samples from joint PDF (R)
- Examples of NHST (R)
- Empirical Bootstrap Example (R)
- Parametric Bootstrap Example (R)

### R Code for Problem Sets

- R Code for Problem Set 1 (R)
- R Code for Problem Set 1 Solutions (R)
- R Code for Problem Set 2 (R) (Computes the exact probability of a run of a given length)
- R Code for Problem Set 2 Solutions (R)
- R Code for Problem Set 3 (R) (problem 2 data)
- R Code for Problem Set 3 Solutions (R)
- R Code for Problem Set 4 Solutions (R)
- R Code for Problem Set 5 Solutions (R)
- R Code for Problem Set 6 Solutions (R)
- R Code for Problem Set 7 Solutions (R)
- R Code for Problem Set 8 Solutions (R)
- R Code for Problem Set 9 Solutions (R)
- R Code for Problem Set 10 Solutions (R)
- R Code for Problem Set 11 Solutions (R)

### Other R Code

- colMatches (R)
- Resets Everthing in RStudio (R)
- Oldfaithful (R) and Oldfaithful data (TXT) (Bootstrap example using the R Old Faithful data set)