03. Using R to look at data
This week …
We’ll spend most of the rest of the semester working in R. Time to learn it! We will learn some basics of R mostly via drawing graphs of our data.
Required Reading
- Hadley Wickham, Garrett Grolemund, and Mine Çetinkaya-Rundel R for Data Science: Import, Tidy, Transform, Visualize, and Model Data, 2nd ed. (Sebastopol, CA: O’Reilly Media, 2023), https://r4ds.hadley.nz.
Read the text online. Complete as much of the “Whole Game” section as you can, i.e. Chapters 1-8. (They are short.) Use the R project for your chosen data, create a new project, or add a Quarto document to your existing class notes project, and try doing some of the examples and code in the Whole Game section using data of your own, or the dataset you chose from last week’s assignment. Don’t worry if things don’t go as expected, but do make a note of what you found difficult or confusing so we can discuss it in seminar.
- Kieran Healy Data Visualization: A Practical Introduction, Second edition. (Princeton: Princeton University Press, 2027), http://socviz.co/. Read Chapters 1 to 4. There’s a good deal of overlap with Wickham et al and with the slides.
I’ve also put the slides up in advance, as we will be working more interactively in class starting this week. So work through the slides alongside the reading. Again, there’s a subtantial amount of overlap between the readings and the slides. Hopefully the repetition will help you get the gist of how the language works. Practice is the best way to learn, though. Ask questions in the Slack if you run into anything you don’t understand, or come to class ready to ask.
Examples
Assignment
Slides
The “R and Quarto” slides repeat some of the material from the first week, just for convenience, and then move on to the introduction to R and ggplot.