How to make graph animations with R

In this post, I will show how to combine a series of plots into a GIF file using the animation package in R.

In this example, I will create a GIF of horizontal bar plots showing how the proportion of men and women have changed in various occupation categories in Canada. Although I will show how to generate the results, I will leave the analysis for another post – this post is just the Data and R code.

Continue reading

R Code: why use ggplot2 instead of plot()?

R is a fairly intuitive language.  It generally does not take long to learn the different variable types, how to import data, the control statements, etc.  However, when it comes to making graphics, there is so much syntax involved that it can be a bit overwhelming.

What is ggplot2? It is a package for R that contains tools for producing various graphics.  I’ll go further into what it is, and how to use it in another post.  The purpose of this post is to show how using the plot() function in R can get unnecessarily complicated, and that the ggplot2 package is a superior alternative.

Continue reading