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 R markdown reports can be used to make your work reproducible, shareable, and one might even say, beautiful.

Key concepts

R vs RStudio, base-R, package, function, argument, objects, environment (workspace), help, R markdown, script, knit, chunk, comments, project

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.

While you’re at it, you should go ahead and install git too. See instructions on Happy Git, sections 4, 6, and 7.

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:

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.8.1-2.8.7), with one modification: Focus on a job you might like to have in the future. In your description, include any ideas about how programming might be able to help you in that job. Include the rest of the information that is requested in the instructions.

Once you are done, you will zip the demo_report folder (instructions: mac, windows) containing your R project, html file, and Rmd file and upload it through the link provided.