# excel file
data <- read_excel("../00_data/MyData.xlsx")
data
## # A tibble: 19 × 100
## Date Opponent Score Column1 `All shifts` `Time on ice` Goals
## <dttm> <chr> <chr> <dbl> <dbl> <chr> <dbl>
## 1 2024-10-24 00:00:00 vs New En… 5:2 0 17 18:02 1
## 2 2024-11-01 00:00:00 @ Univers… 0:5 0 23 22:59 0
## 3 2024-11-03 00:00:00 @ Babson … 4:5 0 23 25:07 0
## 4 2024-11-07 00:00:00 vs SUNY-P… 5:3 0 22 21:26 0
## 5 2024-11-09 00:00:00 @ New Eng… 5:1 0 20 21:19 0
## 6 2024-11-15 00:00:00 vs Worces… 8:2 0 18 18:16 0
## 7 2024-11-21 00:00:00 vs Framin… 7:1 0 20 19:11 0
## 8 2024-11-23 00:00:00 @ Salem S… 4:3 0 24 20:05 0
## 9 2024-11-26 00:00:00 vs Trinit… 1:2 0 24 21:10 0
## 10 2024-12-05 00:00:00 @ UMass D… 4:2 0 17 19:00 0
## 11 2024-12-07 00:00:00 vs Westfi… 1:0 0 27 22:20 1
## 12 2025-01-03 00:00:00 @ Hamilto… 0:4 0 20 19:35 0
## 13 2025-01-04 00:00:00 @ William… 8:2 0 19 18:18 0
## 14 2025-01-09 00:00:00 @ Rivier … 6:1 0 20 18:30 0
## 15 2025-01-11 00:00:00 vs Fitchb… 3:2 0 24 21:30 0
## 16 2025-01-16 00:00:00 @ Worcest… 5:2 0 20 20:22 0
## 17 2025-01-18 00:00:00 vs Massac… 3:1 0 19 17:18 0
## 18 2025-01-23 00:00:00 @ Anna Ma… 2:4 0 25 25:17 0
## 19 NA Average p… <NA> 169 20 18:59 0.17
## # ℹ 93 more variables: `First assist` <dbl>, `Second assist` <dbl>,
## # Assists <dbl>, `Puck touches` <dbl>, `Puck control time` <chr>,
## # Points <dbl>, `+/-` <dbl>, Plus <dbl>, Minus <dbl>, Penalties <dbl>,
## # `Penalties drawn` <dbl>, `Penalty time` <chr>, Hits <dbl>,
## # `Hits against` <dbl>, `Error leading to goal` <dbl>, `Dump ins` <dbl>,
## # `Dump outs` <dbl>, `Team goals when on ice` <dbl>,
## # `Opponent's goals when on ice` <dbl>, Shots <dbl>, `Shots on goal` <dbl>, …
Games with zero shots on goal
filter(data, `Shots on goal` == 0)
## # A tibble: 3 × 100
## Date Opponent Score Column1 `All shifts` `Time on ice` Goals
## <dttm> <chr> <chr> <dbl> <dbl> <chr> <dbl>
## 1 2024-11-07 00:00:00 vs SUNY-Pl… 5:3 0 22 21:26 0
## 2 2024-11-21 00:00:00 vs Framing… 7:1 0 20 19:11 0
## 3 2025-01-09 00:00:00 @ Rivier U… 6:1 0 20 18:30 0
## # ℹ 93 more variables: `First assist` <dbl>, `Second assist` <dbl>,
## # Assists <dbl>, `Puck touches` <dbl>, `Puck control time` <chr>,
## # Points <dbl>, `+/-` <dbl>, Plus <dbl>, Minus <dbl>, Penalties <dbl>,
## # `Penalties drawn` <dbl>, `Penalty time` <chr>, Hits <dbl>,
## # `Hits against` <dbl>, `Error leading to goal` <dbl>, `Dump ins` <dbl>,
## # `Dump outs` <dbl>, `Team goals when on ice` <dbl>,
## # `Opponent's goals when on ice` <dbl>, Shots <dbl>, `Shots on goal` <dbl>, …
Descending Total Shifts
arrange(data, desc(`All shifts`))
## # A tibble: 19 × 100
## Date Opponent Score Column1 `All shifts` `Time on ice` Goals
## <dttm> <chr> <chr> <dbl> <dbl> <chr> <dbl>
## 1 2024-12-07 00:00:00 vs Westfi… 1:0 0 27 22:20 1
## 2 2025-01-23 00:00:00 @ Anna Ma… 2:4 0 25 25:17 0
## 3 2024-11-23 00:00:00 @ Salem S… 4:3 0 24 20:05 0
## 4 2024-11-26 00:00:00 vs Trinit… 1:2 0 24 21:10 0
## 5 2025-01-11 00:00:00 vs Fitchb… 3:2 0 24 21:30 0
## 6 2024-11-01 00:00:00 @ Univers… 0:5 0 23 22:59 0
## 7 2024-11-03 00:00:00 @ Babson … 4:5 0 23 25:07 0
## 8 2024-11-07 00:00:00 vs SUNY-P… 5:3 0 22 21:26 0
## 9 2024-11-09 00:00:00 @ New Eng… 5:1 0 20 21:19 0
## 10 2024-11-21 00:00:00 vs Framin… 7:1 0 20 19:11 0
## 11 2025-01-03 00:00:00 @ Hamilto… 0:4 0 20 19:35 0
## 12 2025-01-09 00:00:00 @ Rivier … 6:1 0 20 18:30 0
## 13 2025-01-16 00:00:00 @ Worcest… 5:2 0 20 20:22 0
## 14 NA Average p… <NA> 169 20 18:59 0.17
## 15 2025-01-04 00:00:00 @ William… 8:2 0 19 18:18 0
## 16 2025-01-18 00:00:00 vs Massac… 3:1 0 19 17:18 0
## 17 2024-11-15 00:00:00 vs Worces… 8:2 0 18 18:16 0
## 18 2024-10-24 00:00:00 vs New En… 5:2 0 17 18:02 1
## 19 2024-12-05 00:00:00 @ UMass D… 4:2 0 17 19:00 0
## # ℹ 93 more variables: `First assist` <dbl>, `Second assist` <dbl>,
## # Assists <dbl>, `Puck touches` <dbl>, `Puck control time` <chr>,
## # Points <dbl>, `+/-` <dbl>, Plus <dbl>, Minus <dbl>, Penalties <dbl>,
## # `Penalties drawn` <dbl>, `Penalty time` <chr>, Hits <dbl>,
## # `Hits against` <dbl>, `Error leading to goal` <dbl>, `Dump ins` <dbl>,
## # `Dump outs` <dbl>, `Team goals when on ice` <dbl>,
## # `Opponent's goals when on ice` <dbl>, Shots <dbl>, `Shots on goal` <dbl>, …
Shot data per game
select(data, Date, Shots, `Shots on goal`, `Blocked shots`, `Missed shots`)
## # A tibble: 19 × 5
## Date Shots `Shots on goal` `Blocked shots` `Missed shots`
## <dttm> <dbl> <dbl> <dbl> <dbl>
## 1 2024-10-24 00:00:00 5 2 3 0
## 2 2024-11-01 00:00:00 10 4 2 4
## 3 2024-11-03 00:00:00 6 4 0 2
## 4 2024-11-07 00:00:00 3 0 3 0
## 5 2024-11-09 00:00:00 4 2 2 0
## 6 2024-11-15 00:00:00 10 4 2 4
## 7 2024-11-21 00:00:00 0 0 0 0
## 8 2024-11-23 00:00:00 6 1 3 2
## 9 2024-11-26 00:00:00 8 3 5 0
## 10 2024-12-05 00:00:00 6 3 3 0
## 11 2024-12-07 00:00:00 9 4 3 2
## 12 2025-01-03 00:00:00 4 3 0 1
## 13 2025-01-04 00:00:00 7 4 2 1
## 14 2025-01-09 00:00:00 3 0 3 0
## 15 2025-01-11 00:00:00 8 7 0 1
## 16 2025-01-16 00:00:00 5 2 3 0
## 17 2025-01-18 00:00:00 6 3 3 0
## 18 2025-01-23 00:00:00 9 6 2 1
## 19 NA 5.8 3 1.77 1.1
Shots blocked percentage
data %>%
mutate(blkPercent = `Blocked shots` / Shots) %>%
select(Date, Shots, `Blocked shots`, blkPercent)
## # A tibble: 19 × 4
## Date Shots `Blocked shots` blkPercent
## <dttm> <dbl> <dbl> <dbl>
## 1 2024-10-24 00:00:00 5 3 0.6
## 2 2024-11-01 00:00:00 10 2 0.2
## 3 2024-11-03 00:00:00 6 0 0
## 4 2024-11-07 00:00:00 3 3 1
## 5 2024-11-09 00:00:00 4 2 0.5
## 6 2024-11-15 00:00:00 10 2 0.2
## 7 2024-11-21 00:00:00 0 0 NaN
## 8 2024-11-23 00:00:00 6 3 0.5
## 9 2024-11-26 00:00:00 8 5 0.625
## 10 2024-12-05 00:00:00 6 3 0.5
## 11 2024-12-07 00:00:00 9 3 0.333
## 12 2025-01-03 00:00:00 4 0 0
## 13 2025-01-04 00:00:00 7 2 0.286
## 14 2025-01-09 00:00:00 3 3 1
## 15 2025-01-11 00:00:00 8 0 0
## 16 2025-01-16 00:00:00 5 3 0.6
## 17 2025-01-18 00:00:00 6 3 0.5
## 18 2025-01-23 00:00:00 9 2 0.222
## 19 NA 5.8 1.77 0.305
Grouped by +/-
data %>%
# Group by airlines
group_by(`+/-`) %>%
# Calc avg dep delay
summarise(avg_dumps = mean(`Dump ins`, na.rm = TRUE)) %>%
# Sort it
arrange(avg_dumps)
## # A tibble: 5 × 2
## `+/-` avg_dumps
## <dbl> <dbl>
## 1 -1 1
## 2 2 1
## 3 0 1.71
## 4 0.48 2
## 5 1 2.2