
In this video, I state the goals of the course.
After viewing this lecture, you will know where to access PITCHf/x data and understand a bit about its structure.
After viewing this lecture, you will be able to scrape the data for a single game from the PITCHf/x website and access the data frames in which the data is stored.
After viewing this lecture, you will be able to join the atbat and pitch data frames.
In this lecture, we select what we need from the atbat data frame.
In this lecture, we select what we need from the pitch data frame.
In this lecture, I give the coordinates of the strike-zone.
After viewing this lecture, you will be able to work with geom_path to draw a strike-zone with ggplot.
After viewing this lecture, you will be able to plot all of the pitches thrown by Max Scherzer as points.
After viewing this lecture, you will be able to use the ggplot size parameter within the aesthetics to visualize the speed of each pitch.
After viewing this lecture, you will be able to use the ggplot color parameter within the aesthetics to visualize the type of each pitch.
After viewing this lecture, you will be able to subset vectors and use the "which" function in R.
After viewing this lecture, you will be able to use the "which" function to generate a more descriptive pitch type column.
After viewing this lecture, you will be able to set the hue of points in ggplot.
After viewing this lecture, you will be able to set the chromaticity, or saturation, of points in ggplot.
After viewing this lecture, you will be able to set the luminance, or brightness, of points in ggplot.
After viewing this lecture, you will be able to use the RColorBrewer package to pick a color palette for displaying points in ggplot.
After viewing this lecture, you will be able to manually specify your own color palette for displaying points in ggplot.
After viewing this lecture, you will understand factors and you will be able to work with them.
After viewing this lecture, you will be able to facet in ggplot, and you will also be able to work with geom_text.
In this lecture, we do more problem solving with the "which" function.
In this lecture, we do more problem solving with factors.
In this lecture, we do more problem solving with faceting and geom_text.
In this lecture, we separate out a single at-bat for visualization. We also learn how to work with the paste function and how to set limits for the axes.
In this lecture, we do more problem solving with geom_text, and we learn about the vjust parameter.
In this lecture, we do more problem solving with the "which" function.
In this lecture, we review grouping and counting with dplyr.
After viewing this lecture, you will be able to use the seq and lapply functions in R.
After viewing this lecture, you will be able to work with the unlist function.
In this lecture, we finally enumerate the pitches within each at-bat.
After viewing this lecture, you will be able to save a plot from ggplot to a png.
In this lecture, we learn how to write a for loop. We also learn how to work with the unique function.
In this lecture, we make the necessary changes to our code withing the for loop.
In this lecture, we discover two additional problems we must solve before our final product is satisfactory.
In this lecture, we learn how to work with the names function to solve our color problem.
In this lecture, I discuss the mappings of intervals to intervals, a technique that will help us solve our speed problem.
In this lecture, we implement the solution described in the last lecture and wrap-up the course.
In this course, we make use of PITCHf/x data to create pitch location charts for a given baseball game. We break the game out into each at-bat and visualize the location, type, and speed of each pitch, the order in which the pitches were thrown, and the outcome of the at-bat.
In order to accomplish this, we will be taking a deep dive into ggplot. We will learn much about how to work with color, how to use aesthetics, and how to facet. We will also gain additional R skills, such as how to subset a vector and how to work with factors.
One should be able to complete the course, at a relaxed pace, in about three weeks. It is best if students already have a little bit of a background in R, dplyr, and ggplot, but it is not completely necessary.