-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy paths1-exercises.Rmd
68 lines (42 loc) · 1.56 KB
/
s1-exercises.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
---
title: "Session 1 Exercises"
author: "Ben Raymond, Adrien Ickowicz"
output:
html_document:
toc: false
theme: flatly
highlight: zenburn
css: "extra/exercises.css"
---
```{r chunkopts, eval = TRUE, echo = FALSE}
knitr::opts_chunk$set(message = FALSE, warning = FALSE)
options(width=80)
options(tibble.width = 80, tibble.print_max = 10, tibble.print_min = 10)
```
# Preparation
Load some packages:
```{r setup}
library(tidyverse)
library(lubridate)
```
And read in our data (set scores from the 2019 D1 Women's NCAA competition, scraped from the NCAA web site).
```{r data}
x <- read_csv("example_data/NCAA_D1W_2019.csv")
glimpse(x)
```
# Exercises
1. What is the date range of the matches?
2. How many matches were played?
3. How many teams?
4. Count the number of matches that went to 3, 4, and 5 sets
5. On average, how many sets were played per match?
6. How many matches did Weber State play?
7. List the top 10 teams in terms of the most matches played
8. Can you re-create the `margin` column, using the other columns in the data set?
9. Using the `margin` column, what was the average winning margin of a set?
10. Does that vary by set number 1--5?
11. Plot a histogram of the score margin (all sets combined)
12. Same thing with each set shown separately
13. Find the most one-sided set result
14. Is there a home team advantage? Find the match win rate for the home team (ignore the fact that some of these matches were played at neutral venues --- just take the `home_team` and `visiting_team` column names on face value)
<div id="footer"></div>