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

“The consulting business may drive sales for a lot of IBM’s own technologies, as well. The company…”
Analyzing Twitter
5 Common Use Cases for Hadoop in Retail
“While touring IBM’s Innovation lab at Lotusphere last…
Big Data, Data Mining and Machine Learning: Deriving Value for Business

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

SAS formally announces integration with R in SAS/IML Studio

1 Min Read

R Examples for Actuaries

3 Min Read

Slides from OSCON

4 Min Read

Thoughts on UseR! 2009

5 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 is improving the safety of cars
From Bolts to Bots: How AI Is Fortifying the Automotive Industry
Artificial Intelligence

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?