9/9/2022
Problem session for Activity 4 and HW#1
- Volunteers will drop their solutions into !Student R Code - Solutions for Activities and Exercises on our Google Drive folder. Please title them HW1Exercise#-yourname.pdf and HW1Exercise#-yourname.R.
Chapter 4 - Data Wrangling on one table- see DataWrangling1.R on our Google Drive folder
- A grammar for data wrangling (dplyr package)
- select() - take a subset of the columns
- filter() - take a subset of the rows
- mutate() - add or modify existing columns
- arrange() - sort the rows
- summarize() - aggregate the data across rows (e.g., group it according to some criteria)
- There are lots of ways to slice-and-dice a single table of data
- dplyr is related to SQL (a relational database querying syntax) and OLAP (online analytical processing) hypercube
- Chapters 15 and 16 provide many more details on SQL
Activity 5 - we will have a PS on Monday
- Replicate the data wrangling used in the extended example of Ben Baumer's time with the NY Mets. You can also change to a team of your choice. For example, I would use the Baltimore Orioles!
Please read Chapter 5 for class on Monday.