Six Home Runs at Riverfront

I made it to my first game in the 2016 baseball season — I watched the Phillies lose to the Reds 10 to 6. One exciting (well, maybe it was exciting if you were a Reds fan) feature of the game were the 6 home runs — two of them accounted for seven of the Reds runs.

The ESPN home run tracker gives a lot of information about each of these home runs including the distance, speed off the bat, apex, etc. For example, we can see that Ryan Howard’s home run was the longest one of that game — that did not surprise me since it was hit to the deepest section of the ballpark.

But this home run tracker does not give us all the information that one might want. What were the pitch types? The ball and strike counts? The pitch locations? (I suspect that most of the home run pitches were in the middle of the strike zone.)

To address these questions, it is relatively easy to download the pitch data from the pitchRx package. I downloaded the data from yesterday’s games and used the filter function (from the dplyr) package to limit my search to the Phillies-Reds game and to the specific six pitches that led to the home runs.

I used ggplot2 to plot the locations of the pitches. I use a “B” symbol to show the location of the batter and display the pitch location and the pitch count. I use different plotting colors to indicate the pitch type.


These graphs are pretty informative.

  1. All six home runs were hit off of fastballs — four were four-seam, one was two-seam and one was a sinker.

  2. Three of the pitch locations to the left-handed batters Bruce and Hunter were located inside and low to middle in the zone — pretty attractive locations for these hitters. Howard’s home run to center field was hit on a pitch in the outer half of the zone of middle height. Suarez’s slam was hit on a fastball at the top edge of the zone; similarly, Ruiz’s home run was hit on a fastball that was a little high but on the inside.

  3. These home runs tended to be hit in batter counts. Bruce’s home runs were hit on 3-1 and 1-1 counts, the slam was hit on a full count, and the home runs by Ruiz and Howard were hit on 0-0 and 1-0 counts.

This pictures reinforce the importance of pitch counts and of pitch locations. Pitchers in early counts and batter counts tend to throw fastballs, and center of the zone locations often have bad consequences for the pitcher.

Here is the complete script I used to download the data and create this graph.

dat <- scrape("2016-04-07", "2016-04-07")
g <- inner_join(select(dat$pitch,
                       pitch_type, px, pz, des, num, start_speed, 
                       pfx_x, pfx_z, count, gameday_link),
                select(dat$atbat, pitcher_name, batter_name, event,
                       stand, num, gameday_link),
my_game <- filter(g, gameday_link=="gid_2016_04_07_phimlb_cinmlb_1")
hr <- filter(my_game, des=="In play, run(s)", event=="Home Run")
hr <- mutate(hr, Event=c("Cedric Hunter", "First Jay Bruce", "Eugenio Suarez",
                          "Ryan Howard", "Second Jay Bruce", "Carlos Ruiz" ),
             position=ifelse(stand=="L", 1.5, -1.5))
plot_locations <- function(pdata, ...){
  topKzone <- 3.5
  botKzone <- 1.6
  inKzone <- -0.95
  outKzone <- 0.95
  kZone <- data.frame(
    x=c(inKzone, inKzone, outKzone, outKzone, inKzone),
    y=c(botKzone, topKzone, topKzone, botKzone, botKzone)
  p <- ggplot(pdata, aes(px, pz, color=pitch_type)) +
    geom_point(size=2.5) +
    geom_path(aes(x, y), data=kZone, lwd=1, col="orange") +
    facet_wrap(~ Event, ncol=2) +
    xlim(-2, 2) + ylim(1, 4.5) +
    geom_text(data=pdata, aes(position, 2.5, label="B"), size=8, color="red") +
        aes(0, 4.2, label=paste('Count:',count)), size=8, color="blue") +
    theme(plot.title = element_text(size = rel(1.5)),
          strip.text = element_text(size = rel(2))) +
plot_locations(hr, "Pitch Locations of Six Home Runs at Riverfront - April 7, 2016")

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: