18.05 | Spring 2022 | Undergraduate

Introduction to Probability and Statistics

R: Information, Tutorials, and Sample Code

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:

  1. Go to the main page of the R project. Click the ‘CRAN’ link on the left. Then choose any of the mirror sites.
  2. 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.

  1. Go to the Download RStudio page and choose the version for your computer (probably the one “recommended for your system”).
  2. 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 Code for Class Slides and Readings

R Code for Problem Sets

Other R Code

Course Info

Departments
As Taught In
Spring 2022
Learning Resource Types
Lecture Notes
Problem Sets with Solutions
Exams with Solutions
Readings
Activity Assignments with Examples
Exam Materials
Tools
Instructor Insights