Lab 02 - CS01 - dplyr practice
Introduction
The main goals of this lab are for you to 1) get more familiar with the CS01 data and 2) gain familiarity with dplyr.
Getting started
To get started, find your lab02-<your GitHub username> repo in the course GitHub organization, clone the repo (using SSH) into RStudio on datahub. And, then you’re ready to go!
Packages
This lab uses two packages: tidyverse (which includes dplyr, the package you’ll be using most in this lab) and (you may want to use) janitor (for clean_names()). Both are loaded for you in the load-packages chunk of the provided .qmd template.
Data
The three data files you’ll be using in this lab have been provided in the data/ folder. You’ll see the following three lines in the provided .qmd template for this lab, which, when run, will read each of the files into R for you:
WB <- read_csv("data/Blood.csv")
OF <- read_csv("data/OF.csv")
BR <- read_csv("data/Breath.csv")Exercises
For each dataset, we want you to start to gain familiarity with the data in there, without having yet been provided much guidance in class. The goal here is to try out as many different dplyr functions as possible…while learning things about the data. For each dataset, use at least three different dplyr functions and state three things you learned about the data while practicing with dplyr.
Exercise 1: Whole Blood
Carry out the above on Whole Blood.
Exercise 2: Oral Fluid
Carry out the above on Oral Fluid.
Exercise 3: Breath
Carry out the above on Breath.
Exercise 4: Summarize
In your own words (no code needed), describe the wrangling that was done overall, focusing on why it was done or what it achieved, rather than on specific lines of code.
Submit
You’ll always want to render your Quarto document to HTML and review that HTML document to ensure it includes all the information you want and looks as you intended, as we grade from the rendered HTML.
Outside resources & AI use: Before submitting, fill in the Outside Resources & AI Use section at the end of your .qmd (write “None” if you didn’t use any). This is required on every assignment.
Yay, you’re done! To finish up and submit, first render your file to HTML. Be sure to select both your .qmd and .html documents when choosing what to commit! Then, commit all remaining changes, use the commit message “Done with Lab 2! 💪”, and push. Before you wrap up the assignment, make sure all documents are updated on your GitHub repo.