animateFX: Animate PITCHf/x

Description Usage Arguments Details Value Examples

View source: R/animateFX.R

Description

Pitch trajectories animated on a two-dimensional plot.

Usage

1
2
3
animateFX(data, pitch_interval = 0.01, layers = facet_grid(~stand),
  color = "pitch_type", point.alpha = 1/3, x_lim = c(-3.5, 3.5),
  y_lim = c(0, 7), movie.name = "animation.gif", ...)

Arguments

data

data frame with appropriately named PITCHf/x variables

layers

list of ggplot2 layer modifications.

color

character. plot point color.

point.alpha

ggplot2 alpha parameter

x_lim

vector(2 element). x axis range.

y_lim

vector(2 element). y axis range.

movie.name

gif image name

...

using in saveGIF

interval

time (in seconds) between plotting the pitch locations.

Details

animateFX plots a series of "snapshots" that represent pitch trajectories from the point of release until all of them reach home plate. The graphic takes on the viewpoint of the umpire; that is, the pitches are getting closer to the viewer with time. This is relected with the increase in size of the "balls" as the animation progresses.

Value

Returns a series of objects of the class used by package ggplot2 to represent plots.

Examples

1
2
3
4
## Not run: 
  animateFX(pitches, interval = 1.0, ani.height = 600, ani.width = 1200)

## End(Not run)

pontsuyu/pitchRx2 documentation built on Dec. 27, 2019, 8:09 a.m.