Data wrangling with the Tidyverse I
Materials for class on Thursday, September 27, 2018
Download the slides from today’s lecture:
Answer your own questions
(Well, my questions for now—but still.)
Setting up your project
(Practice makes perfect!)
Do the following:
Create a new RStudio project named “birds” and put it somewhere on your computer.
Navigate to that new project folder on your computer with Windows Explorer or macOS Finder (i.e. however you look at files on your computer). Create a new folder in your project called “data”.
Download this CSV file:
Birdstrikes_At_Salt_Lake_City_Intl_Airport_2000-2014.csvYou’ll probably need to right click on the link and select “Save link as…” or something similar—often browsers will load the CSV file like a web page, which isn’t helpful.
Using Windows Explorer or macOS Finder, move the newly downloaded CSV file into the “data” folder you created.
Download this R Markdown file:
bird-questions.RmdAgain, you’ll probably need to right click on the link and select “Save link as…”
and place it in your newly-created project (but not in your data folder—put it in the main directory).
In the end, your project folder should be structured like this:
birds\ bird-questions.Rmd birds.Rproj data\ Birdstrikes_At_Salt_Lake_City_Intl_Airport_2000-2014.csv
I provided you with two chunks in the R Markdown file to load and clean the data. Choose a few of these questions and answer them with a table or a plot (or both). You should be able to answer most with
group_by(BLAH) %>% summarize(SOMETHING = BLAH) and with
- Which bird species gets hit the most often?
- Which bird species causes the most damage (in dollars)?
- Has the number of bird strikes increased since 2000?
- Are there any months that are more or less deadly for birds?
- Are there any months that cost more (or less) in damages?
Clearest and muddiest things
Go to this form and answer these three questions:
- What was the muddiest thing from class today? What are you still wondering about?
- What was the clearest thing from class today?
- What was the most exciting thing you learned?
I’ll compile the questions and send out answers after class.