-
Notifications
You must be signed in to change notification settings - Fork 0
/
Kris Bryant Pitches
85 lines (77 loc) · 3.01 KB
/
Kris Bryant Pitches
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Amount & Types of Pitches seen by Kris Bryant
pitch_table <- kb_statcast %>%
group_by(pitch_type) %>%
summarise(N = n()) %>%
mutate(Pct = N / sum(N)) %>%
arrange(desc(N))
pitch_table
Pitch <- c("Changeup", "Curveball", "Cutter", "Four Seam Fastball", "Splitter", "Knuckle Curve", "Sinker", "Slider")
# Barchart of pitches seen by Kris Bryant
kb_chart <- ggplot(pitch_table, aes(pitch_type, N, fill = pitch_type)) +
geom_bar(stat = "identity") +
xlab("Pitch Type") +
ylab("Count") +
ggtitle("Number of Pitches Seen by KB by Pitch Type")
kb_chart
# K-Zone plot of Four-seam Fastballs
k_zone_plot_KB_FF <- ggplot(kb_fastball, aes(x = plate_x, y = plate_z)) +
geom_rect(xmin = -0.947, xmax = 0.947, ymin = 1.5,
ymax = 3.6, fill = "black", alpha = 0.01) +
coord_equal() +
scale_x_continuous("Horizontal Location (ft.)",
limits = c(-2, 2)) +
scale_y_continuous("Vertical Location (ft)",
limits = c(0, 5))
k_zone_plot_KB_FF +
geom_point(aes(color = factor(description))) +
scale_color_manual(values = c("blue", "blue"),
labels = c("KB Swinging Strikes", "2021")) +
labs(title = "Kris Bryant Swinging Strikes FF")
# Plot of Sliders
kb_slider <- kb_statcast %>%
filter(pitch_type == "SL")
View(kb_slider)
Avg_Velo <- mean(kb_slider$release_speed)
Avg_Velo
# Slider movement
slider_movement_horiz <- mean(kb_slider$pfx_x)
slider_movement_vert <- mean(kb_slider$pfx_z)
slider_movement_horiz
slider_movement_vert
# K Zone plot for Sliders
k_zone_plot_KB_SL <- ggplot(kb_slider, aes(x = plate_x, y = plate_z)) +
geom_rect(xmin = -0.947, xmax = 0.947, ymin = 1.5,
ymax = 3.6, fill = "black", alpha = 0.01) +
coord_equal() +
scale_x_continuous("Horizontal Location (ft.)",
limits = c(-2, 2)) +
scale_y_continuous("Vertical Location (ft)",
limits = c(0, 5))
k_zone_plot_KB_SL +
geom_point(aes(color = factor(pitch_type))) +
scale_color_manual(values = c("red", "red"),
labels = c("KB Swinging Strikes", "2021")) +
labs(title = "Kris Bryant Swinging Strikes SL")
# Kris Bryant Against Sinkers
kb_sinker <- kb_statcast %>%
filter(pitch_type == "SI")
View(kb_sinker)
Avg_Velo_Sinker <- mean(kb_sinker$release_speed)
Avg_Velo_Sinker
sinker_movement_horiz <- mean(kb_sinker$pfx_x)
sinker_movement_vert <- mean(kb_sinker$pfx_z)
sinker_movement_horiz
sinker_movement_vert
k_zone_plot_KB_SI <- ggplot(kb_sinker, aes(x = plate_x, y = plate_z)) +
geom_rect(xmin = -0.947, xmax = 0.947, ymin = 1.5,
ymax = 3.6, fill = "black", alpha = 0.01) +
coord_equal() +
scale_x_continuous("Horizontal Location (ft.)",
limits = c(-2, 2)) +
scale_y_continuous("Vertical Location (ft)",
limits = c(0, 5))
k_zone_plot_KB_SI +
geom_point(aes(color = factor(pitch_type))) +
scale_color_manual(values = c("orange", "orange"),
labels = c("KB Swinging Strikes", "2021")) +
labs(title = "Kris Bryant Swinging Strikes SI")