Cookies help us display personalized product recommendations and ensure you have great shopping experience.

By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
SmartData CollectiveSmartData Collective
  • Analytics
    AnalyticsShow More
    image fx (67)
    Improving LinkedIn Ad Strategies with Data Analytics
    9 Min Read
    big data and remote work
    Data Helps Speech-Language Pathologists Deliver Better Results
    6 Min Read
    data driven insights
    How Data-Driven Insights Are Addressing Gaps in Patient Communication and Equity
    8 Min Read
    pexels pavel danilyuk 8112119
    Data Analytics Is Revolutionizing Medical Credentialing
    8 Min Read
    data and seo
    Maximize SEO Success with Powerful Data Analytics Insights
    8 Min Read
  • Big Data
  • BI
  • Exclusive
  • IT
  • Marketing
  • Software
Search
© 2008-25 SmartData Collective. All Rights Reserved.
Reading: Create animated graphics with R
Share
Notification
Font ResizerAa
SmartData CollectiveSmartData Collective
Font ResizerAa
Search
  • About
  • Help
  • Privacy
Follow US
© 2008-23 SmartData Collective. All Rights Reserved.
SmartData Collective > Big Data > Data Mining > Create animated graphics with R
Data MiningPredictive Analytics

Create animated graphics with R

DavidMSmith
DavidMSmith
3 Min Read
SHARE

In a post last week, I wondered whether it was possible to create animated data charts with R. I think I’ve found a solution.

The animations package bills itself as “various functions for animations in statistics, covering many areas such as probability theory, mathematical statistics, multivariate statistics, nonparametric statistics, sampling survey, linear models, time series, computational statistics, data mining and machine learning”, which makes it seem like a collection of specific animation examples. Those examples are indeed there, but of arguably more value is the underlying general framework it provides for creating animations from the standard 2-D plotting tools that R provides.

The basic idea is that you create each frame of the animation as an R chart (using tools like plot, text, lines, etc.).  You bound the code creating the plots with the functions ani.start and ani.stop; within those bounds, each command that would normally create a new page for a plot instead creates a new frame of the animation. By default the animation is saved as an HTML page with an animation driven by JavaScript, but provided you have the appropriate image-conversion tools (ImageMagick and SW…

More Read

PyCon 2008 ElasticWulf Slides
“I propose a new definition of business intelligence … Wikipedia provides a simple layperson…”
Last chance for an early bird rate to hear me speak at Predictive Analytics World
What is Holding Your Business Intelligence Practice Back?
The ‘Big Data’ Buzz – Revolution or Evolution?

In a post last week, I wondered whether it was possible to create animated data charts with R. I think I’ve found a solution.

The animations package bills itself as “various functions for animations in statistics, covering many areas such as probability theory, mathematical statistics, multivariate statistics, nonparametric statistics, sampling survey, linear models, time series, computational statistics, data mining and machine learning”, which makes it seem like a collection of specific animation examples. Those examples are indeed there, but of arguably more value is the underlying general framework it provides for creating animations from the standard 2-D plotting tools that R provides.

The basic idea is that you create each frame of the animation as an R chart (using tools like plot, text, lines, etc.).  You bound the code creating the plots with the functions ani.start and ani.stop; within those bounds, each command that would normally create a new page for a plot instead creates a new frame of the animation. By default the animation is saved as an HTML page with an animation driven by JavaScript, but provided you have the appropriate image-conversion tools (ImageMagick and SWFtools) installed, you can also save the animation as an animated GIF, MPG movie, or SWF animation.

You can see R code examples creating various animations at AniWiki. But be sure to check out the examples of using the animations package to create some cool optical illusions, too.

TAGGED:r
Share This Article
Facebook Pinterest LinkedIn
Share

Follow us on Facebook

Latest News

image fx (2)
Monitoring Data Without Turning into Big Brother
Big Data Exclusive
image fx (71)
The Power of AI for Personalization in Email
Artificial Intelligence Exclusive Marketing
image fx (67)
Improving LinkedIn Ad Strategies with Data Analytics
Analytics Big Data Exclusive Software
big data and remote work
Data Helps Speech-Language Pathologists Deliver Better Results
Analytics Big Data Exclusive

Stay Connected

1.2kFollowersLike
33.7kFollowersFollow
222FollowersPin

You Might also Like

A video introduction to R for Excel users

3 Min Read

Reminder: High-Performance Backtesting Webinar Tomorrow

2 Min Read

Behind the scenes of REvolution’s 64-bit Windows port of R

9 Min Read

Intelligent Enterprise: You Can Predict that R Will Succeed

4 Min Read

SmartData Collective is one of the largest & trusted community covering technical content about Big Data, BI, Cloud, Analytics, Artificial Intelligence, IoT & more.

ai in ecommerce
Artificial Intelligence for eCommerce: A Closer Look
Artificial Intelligence
AI and chatbots
Chatbots and SEO: How Can Chatbots Improve Your SEO Ranking?
Artificial Intelligence Chatbots Exclusive

Quick Link

  • About
  • Contact
  • Privacy
Follow US
© 2008-25 SmartData Collective. All Rights Reserved.
Go to mobile version
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?