2025 September 13,

Math 240: R Instructions

Carleton College, Fall 2025, Joshua R. Davis, , CMC 324, x4095

Introduction

R is a free software system for doing computations in probability and statistics. R is heavily used in academia, industry, and government — everywhere that data are analyzed.

In Math 240, we use R for calculations, examples, and simulations. Early in the term, we spend one day of class going through tutorials. After that, I provide R files occasionally, to help you experiment with probability concepts.

Learning R is not a goal of this course. I'm not going to test you on your R skills, for example. But learning a little bit of R can make your course work easier, and R skills are good for your résumé.

R can be used on its own, but it's more pleasant to run R inside another application, which is called RStudio. There are two ways to access R/RStudio: via a web browser, or by installing it on your own computer.

First Way: Via a Web Browser

If you're off campus, then you need to access Carleton's computer infrastructure through Carleton's VPN (virtual private network). Maybe you already have this tool installed on your computer. If not, then install it following these directions.

Once you are on campus — either physically or through the VPN — go to https://maize.mathcs.carleton.edu/ and sign in using your usual Carleton credentials. An RStudio window should pop up in your web browser.

Now let's test that everything is working. Download my tutorial basics.R to your computer. In RStudio, find the Files pane, which is probably in the lower right corner of the RStudio window. Click the Upload button to upload lab.R from your computer to the server where RStudio is running. Then it should appear in the Files pane. Click it to open it in RStudio. Try running the first few lines of code, to make sure everything is working.

Second Way: Installing on Your Own Computer

Download and install R from the R Project. Then download and install the free desktop version of RStudio from RStudio. Once both pieces are installed, launch the RStudio application.

Now let's test that everything is working. Download my tutorial basics.R to your computer. Double-click the file to open it in RStudio. If that doesn't work, then go into the RStudio application, then to its File menu, and open the file there. Try running the first few lines of code, to make sure everything is working.

More Information

If you like, visit the Math/Stats Department's R/RStudio resources. You can see the schedule for lab assistants, read tutorials, etc.