Tutorial 0: Setting Up R and R Studio

Attempt this tutorial before the first day of class. If you get stuck, I will provide in-class help.

Only the first section below is required.

Required Steps to Install R

This file has instructions for getting set up in R before class starts.1.

  1. Install R

    • Go to R download page
    • Choose the `base’ subdirectory
    • The website should choose the appropriate version for your computer
    • Download
    • Open downloaded .exe file and run
    • Install, accepting defaults
  2. Install RStudio

    • RStudio is an interface for R
    • go to RStudio download page
    • Download RStudio Desktop
    • Open downloaded .exe file and run
    • Install, accepting defaults
  3. Make sure you can open R Studio

    • If you can’t open the program, go get help from CCAS’s OTS
    • You don’t need to do more than open at this point
  4. Quit R Studio

You are now ready to come to class.

Optional Steps to Install Quarto

The remaining steps describe how to create a document that can show your code, the code’s output and your narration or discussion of the code and its output. This type of document is generally called a “markdown” document.

There has just been a big upgrade in R’s ability to create these type of documents, via a new option called quarto. I have created this document with quarto, and this is the first document I have ever created with quarto.

Quarto allows you to produce outputs in many different formats, including the pdf that you will need to do for your homework.

However, the start-up costs of learning quarto are high. Therefore, I encourage this option only if you already feel comfortable with R, or if you feel comfortable with programming. If this is your first time programming, I don’t recommend trying this till much later in the semester, if at all.

All that said, to install quarto, you need to do the following (see fuller version of these instructions here)

  • Open R Studio (making sure you have at least v2022.07)
  • Install three packages – tidyverse, rmarkdown, and palmerpenguins. To do so, at the console window, type
install.packages("tidyverse")
install.packages("rmarkdown")
install.packages("palmerpenguins")
  • Make a quarto project by going to file \(\rightarrow\) New project \(\rightarrow\) Quarto [whatever kind of project you want]
  • Fill in the document as needed

  1. With many thanks to the authors of this helpful website↩︎