Member-only story
How to Build Data Animation In R
Gentle Introduction to gganimate with Example on Racing Bar Chart
Have you seen any beautiful racing bar chart data animation on Youtube and wondered how it was built?
Data visualization with animations is fun to watch. There are various libraries to create spectacular animations. I will show you how to use gganimate in R to animate data by creating a racing bar chart as an example.
What is gganimate
gganimate is a package added to ggplot2. It amid to be the “Grammar of Animated Graphics.” As I mentioned in my other blog post, “Why ggplot2 is so good for data visualization”, ggplot2 was developed behind ideas of Grammar of Graphics. ggplot2 does an excellent job of remapping the core ideas of Grammar of Graphics, but the graphics are static. To see data changing by frames, gganimate expands the Grammar of Graphics to fulfill the animation gap in ggplot2.
gganimate adds additional building blocks on top of ggplot2, which makes it extremely easy to add animation to the…