1  Your New Tools

update obj

Learning Objectives

After completing this lesson learners will be able to:

  • Use R and R Studio on their personal computer.
  • Describe the purpose of the RStudio Script, Console, Environment, and Plots panes.
  • Organize files and directories for a set of analyses as an R Project, and understand the purpose of the working directory.
  • Execute simple commands in the console
  • Use the built-in RStudio help interface to search for more information on R functions.
  • Demonstrate how to provide sufficient information for troubleshooting with the R user community.

1.1 Setup your class folder for success! :cinema:

link to chapter video?

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.

1.1.1 Naming Things

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

  • ALL CAPS (MATH130)
  • no caps (math130)
  • snake_case (math_130)
  • CamelCase (Math130)

1.1.2 Create Folders

  1. On your computer, in an easy to find place, create a new folder named math130.
  2. Then create three subfolders: data, homework, notes.

1.1.3 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.

:x: Do not let files live in your downloads folder.

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

:pencil2: Right click [this link] to download and save Assignment 1 into your homework folder now.

need to fix hw1 link loc and qmd

:cinema: Windows video walk through.

to what?

1.2 Installing R and R Studio

1.2.1 Tablet and Chromebook users

If you are using a tablet, Chromebook or otherwise do not have a computer that you can install programs on, you can use Posit Cloud for this class.

  • Make a Cloud FREE account at https://posit.cloud/plans/free
  • Start a new project by clicking on the button in the top right corner
  • Then go to slide #6 to learn how to navigate RStudio.

The free account allows for 25 project hours/month, which may not be enough for this class. If you run into time limits or you are using this for another class you will have to upgrade to the Cloud Student plan which is $5/month.

Using the cloud is easier to initially setup, but having your own installation on your computer ensures that

  • you want to keep the program free forever
  • you will be able to put your files under version control
  • you always have access to your code even with unstable or no internet

1.3 Download and install R

1.3.1 Step 1: Download R v 4.5+

  • Windows 10 https://cran.r-project.org/bin/windows/base/
  • Mac OS X page - https://cran.r-project.org/bin/macosx/
    • First link under “Latest Release” and looks like R-4.5.0.pkg.
    • :warning: You may later get a message about needing X11 or XQuartz. The download for that program is also on this page. (Mac only)
  • Choose to save the file, do not open or run.

1.3.2 Step 2: Install R

  • 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.

1.4 Download and install R Studio

1.4.1 Step 1: Download the most recent version from

1.4.2 Install the program

  • 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.