LIS 4317 Module #13 Assignment

 

This week, I explored R animations using Yihui Xie's (animation) package, as highlighted on Yihui's blog and Bryan's R-bloggers post. The goal was to create a basic animation and understand how visualization can evolve dynamically with data.

I created a simple animated scatter plot where random points appear and change across 10 frames. The animation simulates data fluctuation over time, using the savegif() function. Each frame displays a new set of random points with vibrant colors for visual clarity.

This kind of animation can be incredibly useful when demonstrating changes over time, such as stock trends, simulation outputs, or even the convergence of algorithms. What I found compelling was how easy it was to implement — a few lines of code produced an engaging visualization.

The animation output was saved as a GIF, making it easy to embed in websites or presentations. This simple tool opens up creative possibilities for storytelling with data something static charts can’t always deliver.

Code Used:

install.packages("animation")

library(animation)

# Save the animation as a GIF

saveGIF({

  for (i in 1:10) {

    plot(runif(10), runif(10), 

         xlim = c(0, 1), ylim = c(0, 1), 

         main = paste("Frame", i),

         col = rainbow(10), pch = 19)

  }

}, movie.name = "random_scatter.gif", interval = 0.5, ani.width = 500, ani.height = 500)

Comments

Popular posts from this blog

LIS 4317 Module #12 Assignment

LIS 4317 Module #11 Assignment

LIS 4317 Final Project