Created
January 10, 2014 00:08
-
-
Save gghatano/8344555 to your computer and use it in GitHub Desktop.
Create a pitting animation of Hisashi-Iwakuma (4/2/2013)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(ggplot2) | |
library(lattice) | |
library(pitchRx) | |
library(plyr) | |
dat0402 <- scrapeFX(start="2013-04-02", end="2013-04-02") | |
pitches0402 <- plyr::join(dat0402$pitch, dat0402$atbat, | |
by = c("num", "url"), | |
type="inner") | |
iwakuma0402 <- subset(pitches0402, pitcher_name=="Hisashi Iwakuma") | |
iwakuma0402_FF_or_FS <- subset(iwakuma0402, pitch_type == "FF" | pitch_type == "FS") | |
animation::saveHTML({ animateFX(iwakuma0402_FF_or_FS, point.alpha = 0.8, layer = facet_grid(pitcher_name~stand)) }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment