Proofs without Words using gganimate
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
I recently watched the 2 part workshop (part 1, part 2) on ggplot2 and extensions given by Thomas Lin Pedersen. First of, it was really nice of Thomas to give the close to 4 hour workshop for the benefit of the community. I personally learnt a lot from it. I wanted to try out gganimate extension that was covered during the workshop.
There are several resources on the web that show animations/illustrations of proofs of mathematical identities and theorems without words (or close to it). I wanted to take a few of those examples and use gganimate to recreate the illustration. This was a fun way for me to try out gganimate.
Example 1:
This example is taken from AoPS Online and the result is that sum of first n odd numbers equals n2. 1+3+5+…+(2n–1)=n2

Example 2:
This example is also taken from AoPS Online and the result is:
13+23+…+(n−1)3+n3=(1+2+…+n)2

Example 3
This example from AoPS Online illustrates the result
122+124+126+128+…=13

Example 4
According to Pythagoras theorem, a2+b2=c2
There was an illustration of the proof of pythogoras theorem in a video from echalk.
The gganimate version of the proof is shown below ( R code, html file)

In summary, it was great to use gganimate for these animations since it does all the magic with making transitions work nicely.
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.