9 Lab: Hello R!
Many of the labs for this course have been adapted from a series of Rstudio tutorials. These tutorials were initially created by Mine Çetinkaya-Rundel. Mine is fantastic; her work is fantastic; and she’s just a badass!
I have adapted these tutorials for two reasons:
I think it useful to see other people working with R; and
Pragmatically, adapting Mine’s lab materials means that I can spend more time on other aspects of the course – like the website, course notes, videos, feedback, learning how to embed tweets…
That's so wonderful to hear, thank you!
— Mine Çetinkaya-Rundel (@minebocek) January 22, 2021
Seriously, you’d never know it, but every hour of finished video takes between 6 and 8 hours to make. (3 hours of writing, 1.5 hours of filming, and 3.5 hours for video editing).
About The Hello R Lab
This lab, collectively named the Hello R lab, is divided into two parts, A and Z. The first part, Aloha R, is focused on setting up GitHub, RStudio, and YAML. It also introduces some basics of R Markdown. The second part, Zdravo R, is the heart of the lab excercises, with a series of data visualization and analysis tasks, introducing ggplot2
, dplyr
, and related tools.
This is the hardest lab of the semester, but it’s also the most important. If you can get through this, you can get through anything. Please complete the lab in order, and don’t skip ahead. You’ll need to know the basics before you can do the more advanced stuff.
Lab Goals
Recall: R is the name of the programming language itself, and RStudio is a convenient interface.
The primary goal of this lab is to introduce you to R and RStudio, tools we will use throughout the course: * to learn the statistical concepts discussed in the course, and * to analyze real data and come to informed conclusions.
Recall: git is a version control system (like “Track Changes” features from Microsoft Word on steroids), and GitHub is the home of your Git-based projects on the Internet (like DropBox but much, much better).
The second goal is to introduce you to Git and GitHub, the collaboration and version control system that we will use throughout the course.
As the labs progress, you are encouraged to explore beyond what the labs dictate; a willingness to experiment will make you a much better programmer. Before we get to that stage, however, you need to build some basic fluency in R. Today, we’ll start with the foundational building blocks of R and RStudio: the interface, reading in data, and basic commands.
To make versioning simpler, this lab is a solo lab. I want to make sure everyone gets a substantial amount of time at the steering wheel, working directly with R.