data(pitches)
#generate animation and prompt default web browser to view the sequence of plots
animation::saveHTML({ animateFX(pitches, layer = facet_grid(pitcher_name~stand)) })
animation::saveHTML({ animateFX(pitches, avg.by="pitch_types",
layer = facet_grid(pitcher_name~stand))
})Run the code above in your browser using DataLab