Introduction to R and RStudio
Objectives
This week, we’ll get started with familiarizing ourselves with R and RStudio. You should come to class with software already installed on your laptop (see below for instructions). During class, we will learn how to interact the RStudio interface. We’ll also talk about what reproducible scientific programming is, and how Quarto documents can be used to make your work reproducible, shareable, and one might even say, beautiful.
Readings and other preparation
You should install R and RStudio before class. If you already have them installed, please update to the latest versions. Here are some directions on how to install (or update) these software packages.
For our first week, you do not to read ahead of the class period. But you should read these chapters afterward to solidify what we’ve discussed in class:
- Applied Data Skills - Chapter 1: Intro to R and RStudio
- Applied Data Skills - Chapter 2: Reports with R Markdown
Slides
Slides have been adapted from the textbook readings using Claude AI.
In-class exercises
We will follow along with the examples given in the textbook. In addition, we will make sure everyone is set up with the software and with Canvas.
Weekly assignment
Create the demo_report project following the instructions in the textbook under Exercises (2.7). You will complete this on your own, and you can ignore the instructions to share it on Teams (you will upload it through the link on BruinLearn instead). Include all of the information that is requested in the instructions for your CV.
In addition:
- Please also include a sentence or two describing how programming might be able to help you in the future (e.g., in school or in a job).
- Find an example of a data visualization that you like. This can be from any source, but if you need some inspiration, here are a couple of galleries (one, two) showing off plots created with the
ggplot2package in R. In a few weeks, we’ll talk about when you might want to use different kinds of plots and how to create them in R. You should embed the plot into your Quarto report, either by downloading it or by linking to it directly. Here’s more info about how that works.
Once you are done, you will zip the demo_report folder (instructions: mac, windows) containing your R project, html file, and qmd file and upload it through the link provided.