# Filter the data for the pitcher Reed Interdonato
Brian_Foley_data <- data %>%
filter(Pitcher == "Interdonato, Reed")
# Create a detailed table for each pitch
detailed_pitch_table <- Brian_Foley_data %>%
select(AutoPitchType, RelSpeed, SpinRate, SpinAxis, HorzBreak, InducedVertBreak, PitchCall, RelHeight, RelSide, Extension) %>%
rename(
ReleaseSpeed = RelSpeed,
Tilt = SpinAxis,
HorizontalBreak = HorzBreak,
InducedVerticalBreak = InducedVertBreak,
ReleaseHeight = RelHeight,
ReleaseSide = RelSide
) %>%
mutate(
ReleaseSpeed = round(ReleaseSpeed, 2),
SpinRate = round(SpinRate, 2),
Tilt = round(Tilt, 2),
HorizontalBreak = round(HorizontalBreak, 2),
InducedVerticalBreak = round(InducedVerticalBreak, 2),
ReleaseHeight = round(ReleaseHeight, 2),
ReleaseSide = round(ReleaseSide, 2),
Extension = round(Extension, 2),
ClockTilt = round((Tilt / 30) %% 12, 1) # Interpret Tilt as clock face
)
# Display the detailed table
knitr::kable(detailed_pitch_table, caption = "Detailed Pitch Table for Reed Interdonato")
Detailed Pitch Table for Reed Interdonato
Sinker |
91.08 |
2408.01 |
245.45 |
20.92 |
10.74 |
StrikeSwinging |
5.60 |
2.11 |
6.55 |
8.2 |
Four-Seam |
90.02 |
2388.59 |
217.04 |
13.44 |
18.99 |
InPlay |
5.60 |
1.81 |
6.09 |
7.2 |
Sinker |
92.00 |
2406.57 |
243.68 |
19.38 |
10.81 |
BallCalled |
5.68 |
2.25 |
6.47 |
8.1 |
Sinker |
91.92 |
2416.16 |
247.65 |
21.67 |
10.13 |
BallCalled |
5.56 |
2.22 |
6.44 |
8.3 |
Four-Seam |
91.24 |
2495.45 |
223.58 |
15.56 |
17.58 |
StrikeCalled |
5.60 |
1.97 |
6.77 |
7.5 |
Four-Seam |
92.73 |
2433.36 |
222.01 |
15.53 |
18.42 |
BallCalled |
5.62 |
1.97 |
6.66 |
7.4 |
Sinker |
91.73 |
2264.87 |
246.59 |
21.22 |
10.43 |
BallCalled |
5.57 |
2.06 |
6.76 |
8.2 |
Sinker |
92.26 |
2472.67 |
237.00 |
19.42 |
13.87 |
StrikeCalled |
5.66 |
2.03 |
6.50 |
7.9 |
Changeup |
85.68 |
1694.23 |
238.61 |
13.66 |
9.65 |
BallinDirt |
5.30 |
2.17 |
6.67 |
8.0 |
Sinker |
93.27 |
2431.25 |
242.49 |
19.27 |
11.23 |
BallCalled |
5.63 |
2.11 |
6.57 |
8.1 |
Sinker |
91.88 |
2420.93 |
247.19 |
20.47 |
9.86 |
InPlay |
5.61 |
1.97 |
6.37 |
8.2 |
Changeup |
84.76 |
1751.33 |
217.55 |
11.77 |
16.67 |
FoulBallNotFieldable |
5.25 |
2.26 |
6.61 |
7.3 |
Four-Seam |
94.43 |
2612.89 |
232.69 |
19.30 |
15.79 |
FoulBallNotFieldable |
5.71 |
1.91 |
6.19 |
7.8 |
Slider |
84.37 |
2209.08 |
189.50 |
0.78 |
6.05 |
BallCalled |
5.35 |
2.40 |
5.86 |
6.3 |
Four-Seam |
93.59 |
2530.34 |
230.71 |
18.85 |
16.51 |
BallCalled |
5.70 |
2.13 |
6.39 |
7.7 |
Sinker |
91.54 |
2412.49 |
232.66 |
19.14 |
15.77 |
InPlay |
5.70 |
1.78 |
6.51 |
7.8 |
Slider |
85.70 |
2247.79 |
218.81 |
1.89 |
3.50 |
BallCalled |
5.46 |
2.14 |
5.98 |
7.3 |
Sinker |
91.46 |
2418.09 |
229.72 |
17.72 |
16.22 |
StrikeCalled |
5.72 |
1.83 |
6.66 |
7.7 |
Slider |
85.57 |
2331.15 |
185.74 |
0.31 |
4.24 |
InPlay |
5.44 |
2.16 |
5.92 |
6.2 |
Sinker |
90.99 |
2524.77 |
230.39 |
18.07 |
16.14 |
FoulBallNotFieldable |
5.64 |
2.03 |
6.55 |
7.7 |
Sinker |
92.32 |
2447.18 |
226.00 |
18.75 |
19.29 |
BallCalled |
5.86 |
1.73 |
6.35 |
7.5 |
Sinker |
92.15 |
2456.99 |
228.16 |
18.27 |
17.51 |
BallCalled |
5.86 |
1.72 |
6.51 |
7.6 |
Slider |
84.12 |
2356.73 |
177.31 |
-0.12 |
4.05 |
BallCalled |
5.47 |
2.18 |
5.75 |
5.9 |
Slider |
83.40 |
2244.57 |
119.07 |
-2.61 |
2.82 |
BallCalled |
5.48 |
2.11 |
5.82 |
4.0 |
Slider |
85.52 |
2263.36 |
202.03 |
2.62 |
7.79 |
BallCalled |
5.48 |
2.03 |
5.95 |
6.7 |
Sinker |
90.67 |
2450.54 |
225.79 |
17.78 |
18.47 |
BallCalled |
5.85 |
1.66 |
6.73 |
7.5 |
Four-Seam |
92.09 |
2527.90 |
226.35 |
18.96 |
19.26 |
StrikeCalled |
5.80 |
1.73 |
6.42 |
7.5 |
Four-Seam |
93.23 |
2485.46 |
228.84 |
19.70 |
18.39 |
FoulBallNotFieldable |
5.83 |
1.77 |
6.41 |
7.6 |
Slider |
84.91 |
2195.69 |
227.03 |
1.84 |
2.94 |
FoulBallNotFieldable |
5.47 |
2.13 |
5.87 |
7.6 |
Sinker |
93.85 |
2331.10 |
228.63 |
16.43 |
15.62 |
BallCalled |
5.93 |
1.48 |
6.47 |
7.6 |
Slider |
85.98 |
2297.81 |
176.40 |
-0.22 |
4.72 |
StrikeSwinging |
5.47 |
2.15 |
5.92 |
5.9 |
Sinker |
91.42 |
2390.11 |
234.07 |
16.84 |
13.34 |
InPlay |
5.86 |
1.55 |
6.57 |
7.8 |
Sinker |
91.88 |
2376.39 |
235.12 |
18.84 |
14.33 |
BallCalled |
5.59 |
2.13 |
6.55 |
7.8 |
Sinker |
92.06 |
2343.86 |
234.37 |
17.89 |
13.98 |
StrikeCalled |
5.49 |
1.95 |
6.37 |
7.8 |
Sinker |
91.20 |
2324.41 |
228.01 |
16.25 |
15.77 |
InPlay |
5.74 |
1.95 |
6.69 |
7.6 |
Sinker |
92.87 |
2257.35 |
234.21 |
19.64 |
15.31 |
BallCalled |
5.96 |
1.65 |
6.35 |
7.8 |
Four-Seam |
91.34 |
2456.75 |
225.33 |
16.22 |
17.23 |
StrikeCalled |
6.00 |
1.73 |
6.45 |
7.5 |
Slider |
85.58 |
2321.08 |
208.06 |
1.44 |
4.04 |
BallCalled |
5.57 |
2.04 |
5.77 |
6.9 |
Slider |
85.66 |
2218.49 |
208.78 |
1.64 |
4.29 |
StrikeCalled |
5.55 |
2.01 |
5.98 |
7.0 |
Four-Seam |
93.28 |
2484.72 |
232.30 |
18.90 |
15.75 |
BallCalled |
5.95 |
1.73 |
6.48 |
7.7 |
Slider |
85.04 |
2258.75 |
210.09 |
1.56 |
3.75 |
InPlay |
5.57 |
2.23 |
5.84 |
7.0 |
Sinker |
92.12 |
2464.65 |
235.39 |
18.96 |
14.31 |
StrikeCalled |
5.69 |
1.87 |
6.03 |
7.8 |
Changeup |
85.14 |
1726.30 |
250.58 |
16.62 |
7.17 |
BallCalled |
5.41 |
1.91 |
6.47 |
8.4 |
Four-Seam |
92.96 |
2303.64 |
224.38 |
15.94 |
17.46 |
BallCalled |
5.71 |
1.83 |
6.20 |
7.5 |
Sinker |
90.54 |
2264.88 |
227.48 |
17.14 |
16.98 |
InPlay |
5.78 |
1.96 |
6.40 |
7.6 |
Sinker |
92.16 |
2424.94 |
228.04 |
18.86 |
18.25 |
BallCalled |
5.82 |
1.87 |
6.08 |
7.6 |
Sinker |
91.88 |
2354.66 |
231.33 |
18.98 |
16.44 |
BallCalled |
5.57 |
2.17 |
6.48 |
7.7 |
Sinker |
92.23 |
2390.58 |
229.11 |
18.25 |
17.03 |
BallCalled |
5.79 |
1.90 |
6.39 |
7.6 |
Sinker |
89.84 |
2387.21 |
227.57 |
18.83 |
18.52 |
StrikeCalled |
5.77 |
1.93 |
6.19 |
7.6 |
Sinker |
91.66 |
2433.83 |
227.72 |
18.84 |
18.38 |
BallCalled |
5.66 |
2.04 |
6.22 |
7.6 |
# Calculate the total number of pitches
total_pitches <- nrow(detailed_pitch_table)
# Create a summary table
pitch_summary <- detailed_pitch_table %>%
group_by(AutoPitchType) %>%
summarise(
TotalPitches = n(),
Usage = sprintf("%.2f%%", n() / total_pitches * 100),
Balls = sum(PitchCall %in% c("BallCalled", "BallinDirt")),
Strikes = sum(!PitchCall %in% c("BallCalled", "BallinDirt")), # Count everything not a ball as a strike
BallPercentage = sprintf('%.2f%%', Balls / TotalPitches * 100),
StrikePercentage = sprintf('%.2f%%', Strikes / TotalPitches * 100),
AvgVelocity = round(mean(ReleaseSpeed, na.rm = TRUE), 2),
AvgSpinRate = round(mean(SpinRate, na.rm = TRUE), 2),
AvgInducedVertBreak = round(mean(InducedVerticalBreak, na.rm = TRUE), 2),
AvgHorzBreak = round(mean(HorizontalBreak, na.rm = TRUE), 2),
AvgTilt = round(mean(Tilt, na.rm = TRUE), 2),
AvgClockTilt = round(mean(ClockTilt, na.rm = TRUE), 1), # Clock face interpretation
AvgReleaseHeight = round(mean(ReleaseHeight, na.rm = TRUE), 2),
AvgReleaseSide = round(mean(ReleaseSide, na.rm = TRUE), 2),
AvgExtension = round(mean(Extension, na.rm = TRUE), 2)
) %>%
select(AutoPitchType, Usage, everything())
# Display the total number of pitches
cat("Total number of pitches thrown: ", total_pitches, "\n")
## Total number of pitches thrown: 50
# Display the summary table
knitr::kable(pitch_summary, caption = "Summary Pitch Table for Reed Interdonato")
Summary Pitch Table for Reed Interdonato
Changeup |
6.00% |
3 |
2 |
1 |
66.67% |
33.33% |
85.19 |
1723.95 |
11.16 |
14.02 |
235.58 |
7.9 |
5.32 |
2.11 |
6.58 |
Four-Seam |
20.00% |
10 |
4 |
6 |
40.00% |
60.00% |
92.49 |
2471.91 |
17.54 |
17.24 |
226.32 |
7.5 |
5.75 |
1.86 |
6.41 |
Sinker |
52.00% |
26 |
14 |
12 |
53.85% |
46.15% |
91.81 |
2395.17 |
14.95 |
18.76 |
233.99 |
7.8 |
5.72 |
1.92 |
6.45 |
Slider |
22.00% |
11 |
6 |
5 |
54.55% |
45.45% |
85.08 |
2267.68 |
4.38 |
0.83 |
192.98 |
6.4 |
5.48 |
2.14 |
5.88 |
# Calculate maximum fastball velocity
max_fb_velocity <- detailed_pitch_table %>%
filter(AutoPitchType %in% c("Four-Seam", "Sinker", "Cutter")) %>%
summarise(MaxFBVelocity = max(ReleaseSpeed, na.rm = TRUE)) %>%
pull(MaxFBVelocity)
# Display the maximum fastball velocity
cat("Reed Interdonato maximum FB velocity: ", max_fb_velocity, "mph\n")
## Reed Interdonato maximum FB velocity: 94.43 mph
# Prepare data for plotting pitch locations
pitch_location_data <- Brian_Foley_data %>%
select(AutoPitchType, PlateLocHeight, PlateLocSide, PitchCall) %>%
rename(
PitchHeight = PlateLocHeight,
PitchSide = PlateLocSide
) %>%
mutate(
SwingTake = ifelse(PitchCall %in% c("StrikeSwinging", "FoulBall", "FoulBallFieldable", "FoulBallNotFieldable", "InPlay"), "Swing", "Take"),
Chase = ifelse(SwingTake == "Swing" & (PitchSide < -0.85 | PitchSide > 0.85 | PitchHeight < 1.5 | PitchHeight > 3.5), "Chase", "Non-Chase")
)
# Create the scatter plot with specified strike zone boxes
ggplot(pitch_location_data, aes(x = PitchSide, y = PitchHeight, color = SwingTake, shape = Chase)) +
geom_point(size = 3) +
geom_rect(aes(xmin = -0.5, xmax = 0.5, ymin = 1.75, ymax = 3.25), fill = NA, color = "red", linetype = "solid", size = 1) +
geom_rect(aes(xmin = -0.85, xmax = 0.85, ymin = 1.5, ymax = 3.5), fill = NA, color = "black", linetype = "solid", size = 1) +
geom_rect(aes(xmin = -1.25, xmax = 1.25, ymin = 1.25, ymax = 3.75), fill = NA, color = "gray", linetype = "solid", size = 1) +
scale_x_continuous(limits = c(-2, 2)) +
scale_y_continuous(limits = c(0, 5)) +
coord_fixed(ratio = 1) +
labs(title = "Pitch Locations for Reed Interdonato",
x = "Horizontal Location (feet)",
y = "Vertical Location (feet)",
color = "Swing/Take",
shape = "Chase") +
facet_wrap(~ AutoPitchType) +
theme_minimal() +
theme(
legend.position = "right",
panel.grid.major = element_line(color = "grey80"),
panel.grid.minor = element_line(color = "grey90"),
axis.text = element_text(color = "black"),
axis.title = element_text(color = "black"),
plot.title = element_text(color = "black"),
legend.background = element_rect(fill = "white", color = NA),
legend.key = element_rect(fill = "white", color = NA),
legend.text = element_text(color = "black"),
legend.title = element_text(color = "black")
)

# Create the scatter plot for horizontal and vertical breaks
ggplot(detailed_pitch_table, aes(x = HorizontalBreak, y = InducedVerticalBreak, color = AutoPitchType)) +
geom_point(size = 3) + # Increase point size
scale_x_continuous(limits = c(-25, 25)) + # Set horizontal limits to +/- 25 inches
scale_y_continuous(limits = c(-25, 25)) + # Set vertical limits to +/- 25 inches
labs(title = paste("Pitch Movement"),
x = "Horizontal Break (inches)",
y = "Induced Vertical Break (inches)",
color = "Pitch Type") +
theme_minimal() +
theme(
legend.position = "right",
panel.grid.major = element_line(color = "grey80"),
panel.grid.minor = element_line(color = "grey90"),
axis.text = element_text(color = "black"),
axis.title = element_text(color = "black"),
plot.title = element_text(color = "black"),
legend.background = element_rect(fill = "white", color = NA),
legend.key = element_rect(fill = "white", color = NA),
legend.text = element_text(color = "black"),
legend.title = element_text(color = "black")
)
