6 - Replicating your work in Excel with R
Tuesday, February 18
Beginning this week, I’ll start adding additional tutorials and resources at the bottom of each page for people who feel like they’d like to go further than what we’ll get to in class. There is absolutely NO expectation that you’ll do this. It’s only there if you want it.
In class
Tuesday
- Filtering in R: We’ll take on the Murder Accountability Project’s database
R Data file for download | Exercises,
Here is a quote from the Serial Killer Detective about the Green River Killer. Let’s see if we can build a query that might isolate at least some of those cases:
Ridgway’s slayings began in 1982, when young runaways and prostitutes began disappearing from state Route 99 in south King County, Washington. He brought many of them to his home and strangled them, then left them in woodsy, remote sites. The first few bodies turned up along the now-notorious Green River.
Ridgway told investigators he killed as many as 75-80 women along Route 99 in south King County, Washington. He was convicted and received multiple life sentences.
(I decided the NEA data wasn’t a good fit for today’s work.)
Thursday
- Grouping and summarising in R: More with the Murder Accountability Project data.
Due this week
-
Sunday, Feb. 16: Nothing except the lab. Take this time to carefully go through all of the material in R until you’re comfortable with it. If you have a “eureka!” moment, post it to Slack in the new #wins channel. If you need help, post it in #sos using the principles of asking good questions.
-
Sunday, Feb. 23: Finish your lab work and upload it. You can work on it together if you want, but everyone should have their own document and it should have a list of names of people who contributed to it outside of class.
Preparation
Skills
Try to follow along with the examples in the chapters, but you don’t have to do the exercises unless they’re assigned. We’ll work on the murder data from the filtering chapter in class. (I will post the data for the vaccinations and show you how to load it into R by Friday.)
- R Study Guide chapters 5.1-5.3:
- A quick tour of verbs
- Verbs Part 1: Picking and choosing (for Tuesday)
- Verbs Part 2: group_by and summarise (for Thursday)
Reading
- “Pharmacies miss half of dangerous drug combinations”, Chicago Tribune, Dec. 15, 2016, by Sam Roe and Karisa King.
Going further
R had powerful ways to work with text using regular expressions
. To get a handle on what regular expressions can do, go through the tutorial on our resources site. It’s not in R, but it will translate directly into filtering in R using the str_detect() function.