Description Usage Arguments Details Value Examples
Visualize balls in play
Visualize Balls in Play
1 2 3 4 5 6 7 8 |
x |
An object of class |
... |
arguments passed to |
batterName |
A character string containing the last name of a batter |
pitcherName |
A character string containing the last name of a pitcher |
events |
A vector of MLBAM event types for which to filter. (e.g. 'Home Run') |
A convenience function for drawing a generic baseball field using a Cartesian coordinate system scaled in feet with home plate at the origin.
Plots the balls in play from an object of class GameDayPlays
. This function will plot (x,y)-coordinates
with a generic baseball field plotted in the background. Other lattice options can be passed
to xyplot
.
an xyplot()
1 2 3 4 5 6 | plot(May)
plot(May, events = c("Single","Double","Triple","Home Run"), pch = 16)
plot(May, batterName = "Trout", main = "Mike Trout's May 2013", pch = 16)
plot(May, pitcherName = "Kershaw", main = "Clayton Kershaw's May 2013", pch = 16)
plot(May, batterName = "Tulowitzki", pitcherName = "Kershaw",
main = "Clayton Kershaw versus Troy Tulowitzki: May 2013", pch = 16, cex = 3)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.