My First Animated Gifs! (with R)

Ever since I found this tutorial yesterday, I have been so excited to be making animated gifs in R.  In fact, last night as I was laying my head upon my pillow, I almost couldn’t fall asleep because I kept thinking about all of the possibilities!  This could be great for visualizing different distributions in my probability class, or by trying to find some patterns in large data sets.  There are so many possibilities, my mind is boggled.

So today I put the tutorial to use, and made this animation.  Can you guess what it is?


It is an animated gif of wind patterns from January 1, 2013 until July 31, 2014 from measurements taken at 12,000 weather stations!

I used data that I queried from this website.  The data came in the form of about 12,000 .csv files: one .csv file for every weather station!  Fortunately I found the rbind.fill and this made combining these 12,000 data sets into a single data set fast and simple!  Now I have a single data set with 6.8 million rows!  Yowzers!!

The darker colors represent weather stations that had higher winds, and the lighter colors represent weather stations that had lower winds.  It is really cool that just by looking at wind patterns we can see the shape of the great lakes and also get some hints about where large mountain ranges are.

I also decided to make an animated gif of precipitation over the same time period, this time using white as the background color.  Here’s what I got:


The darker colors correspond to more precipitation and the lighter colors correspond to less precipitation.  As you are looking at this gif, keep an eye out for Seattle.  They really seem to earn their reputation of being the rainiest city in the US.

I hope you enjoyed these!  I enjoyed making them.

This entry was posted in Uncategorized. Bookmark the permalink.