R is the programming language that we will be using. R Studio is the program we will use R through. You must install both. This page provides instructions on how to set up R and R Studio.

If you are using a tablet, Chromebook or otherwise do not have a computer that you can install programs on, you will need to use head over to RStudio Cloud (http://rstudio.cloud.com), make an account and start a new project.

Once you are done, come back to this page and pick up at “Navigating R Studio”

A free RStudio Cloud account gives you ~25 hours/monthly, which may not be enough for this class. The next level upgrade gives you 75 hours/month for $5/month which should be plenty of hours. If this is not a viable solution for you there are physical campus computers that you can use, the wildcat virtual lab, and loaner laptops for in class use only.

While the cloud is easier to initially setup, I want you to only use it if you absolutely have to. Having your own installation on your computer ensures that

  • you can customize your programs
  • you will be able to put your files under version control
  • you always have access to your code even with unstable or no internet

Download and install R

🔽 Download R v 4.1+

✏️ Install

  • Install R by double clicking on the downloaded file and following the prompts.
    • Default settings are OK.
    • Delete any desktop shortcuts that was created (looks like the icon above.)

🎦 Video Tutorials for both R and R Studio.


Download and install R Studio

🔽 Download v1.4 +

✏️ Install

  • Windows: Double click on the downloaded file to run the installer program.
  • Mac: Double click on the downloaded file, then drag the R Studio Icon into your Applications folder.
    • After you are done, eject the “Drive” that you downloaded by dragging the icon to your trash.

Setting preferences in R Studio

Retain sanity while troubleshooting

  • Open R Studio and go to the file menu go to Tools then Global Options.
  • Uncheck “Restore .RData into workspace at startup”
  • Where it says “Save workspace to .RData on exit:” Select “Never”"
  • Click apply then ok to close that window.

This will ensure that when you restart R you do not “carry forward” objects such as data sets that you were working on in a prior assignment.

To effectively restart R, go to the file menu and click Session , then “Restart R”, or “Restart R and clear output”.

🎦 Link to video walk through


Adding \(\LaTeX\) onto R Studio

This is a math class, and so you will be needing to write math. But on a computer. To write math notation in your homework, you need a typesetting program called \(\LaTeX\) (pronounced “lay-tek” or “lah-tex”). It’s a super neat program, but also nearly 4Gb. Too big for our needs. That’s where the tinytex package came from. we’re going to use it to install a lightweight version of \(\LaTeX\). This will let us write math equations in R Markdown, and create PDF’s of your homework. Both of which are necessary for this class.

This is a two step process:

  1. In your R console type the following and press Enter.
install.packages("tinytex")

When the download and install is complete, you should see a message similar to:

The downloaded binary packages are in
    C:\Users\Robin\AppData\Local\Temp\Rtmpi8NAym\downloaded_packages
  1. In your console type the following and press Enter.
tinytex::install_tinytex()

Installing other packages

R is an open source program with thousands of people contributing by writing packages that contain functions that let us do nifty stuff. Just like above with tinytex, you can add those packages to your R installation by typing

install.packages("package name")

where the package names for the packages you need are are listed below. Install them in the order listed to avoid duplication of installation. It’s not a huge deal, just unnecessary.

  • openintro
  • devtools
  • learnr

Lastly, install the ChicoLearnR directly from github by typing the following:

devtools::install_github("norcalbiostat/ChicoLearnR")
  • If you get prompted to updated packages, go ahead and enter 1 to choose all packages listed.
  • You may see a message about needing to install RTools to build packages. You should be fine without it.

When done, restart R studio.

Confirm you have the class tutorials

In the top right panel, click the Tutorial tab. If you don’t see Section 1 Introduction to R from the ChicoLearnR package then something didn’t work during the installation. Try to install the ChicoLearnR package again and seek assistance from your peers, the instructor, or Community Coding.


Downloading class materials

Setup your folder for success!

Using a consistent folder structure across your projects will help keep things organized, and will also make it easy to find/file things in the future. This can be especially helpful when you have multiple projects.

You also need to choose a naming convention for your class folder and stick with it. Recommended options are:

  • ALL CAPS (MATH350)
  • no caps (math350)
  • snake_case (math_350)
  • CamelCase (Math350)

✏️ On your computer, in an easy to find place, create a new folder named math350 using whatever naming convention you choose. 🎦 Windows video walk through.

Adding files into your class folder

When you download a file, right click and “Save as” or “Save target as” and actively choose where to download this file.

❌ Do not let files live in your downloads folder.

❌ Do not open any files from your browser window after downloading.

🔽 Right click [this link] to download and save Assignment 1 into your homework folder now.
- Then rename the file to replace template with your username. - E.g. mine would look like hw_01_rdonatello.Rmd