Site icon R-bloggers

Making an Animated Heart GIF in R

[This article was first published on Data, Evidence, and Policy - Jared Knowles, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Messing around with animations, I created this toy example to make a growing outline of a heart in R. I have put it up as a gist on GitHub and embedded it below. It uses the animation and the ggplot2 packages–both of which make it incredibly simple to make a good looking graphic.

 The formula to draw the hearts can be found thanks to Wolfram MathWorld.

 

To leave a comment for the author, please follow the link and comment on their blog: Data, Evidence, and Policy - Jared Knowles.

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.