demo('estimate_pi', package = 'animation') (thanks,saveGIF() didn’t work when the optionani.dev is set to a function (thanks,
Theani.res option works forsaveHTML()andsaveVideo() now (thanks,
Theani.res option works for arbitrary graphicaldevices now (thanks,
Added a new optionani.res to ani.options(), tocontrol the resolution of png, jpeg, bmp and tiff images when usingsaveGIF() (#99).
saveGIF() and im.convert() now support converting using the‘magick’ R package which does not require shelling out to externalsoftware.
saveGIF() on Windows might give an error message “the input lineit too long” when the command to be passed to ImageMagick/GraphicsMagicis too long; now the command is quoted by double quotes (based on ananswer to http://stackoverflow.com/q/682799/559676) (thanks, AaronDodd)
save*() functions should overwrite the output file (#50,#60).
the default value for the argumentother.opts insaveVideo() was changed to ‘-pix_fmt yuv420p’ when the output format isMP4 (Skye Bender-deMoll, #49)
the defunct functions highlight.def(), write.rss() and ani.news()were finally removed from this package
the functions ani.start() and ani.stop() are defunct and will beremoved in the next version of this package; please use saveHTML()instead
the animation optionoutdir in ani.options() wasremoved because it was confusing to many users that the output is in atemporary directory by default; now all files are written relative tothe current working directory (#31)
the animation optionconvert in ani.options() isexpected to be the path to ImageMagick/GraphicsMagickwithoutquotes, i.e. not the shQuote() version (#35)
the animation option ‘htmlfile’ in ani.options() was removed,because it was only used in saveHTML() and g.brownian.motion(), and isnot a general enough option
the ‘clean’ argument in saveVideo() was removed: images will becreated in the temporary directory, and will not be explicitly cleaned(R will clean them then it quits)
datasets in this package are lazy loaded now, which means we nolonger need, for example, data(pollen) – just use pollen
added an article in the articles/ directory of the package, whichwill be published in the Journal of Statistical Software; seecitation(‘animation’)
x- and y-axis in the top scatter plot in boot.iid() are switched;now x-axis is the sample value and y-axis is the index
Rosling.bubbles() was rewritten to avoid .Internal() and theusage was slightly changed (see documentation)
demo(‘elephant’) to show a winking pink elephant; who saidelephants cannot dance? (thanks, Neil Gunther)
all animations are using dev.hold() and dev.flush() now, so theywill no longer flicker under Linux and Mac
saveGIF() and im.convert() returns the command for theconversion, which might be helpful for debugging. A note on the limit ofImageMagick or GraphicsMagick was added to the documentation ofim.convert() (thanks, Florian Knorr)
fixed a typo in ?animation (imgname should be img.name; thanks,Neuwirth Erich)
ani.pause() gained an argument ‘interval’ to specify the timeinterval directly
for saveLatex(): when full.path = TRUE, will be replaced with /in the file path so that LaTeX can really find the animation file underWindows
ani.options() will perform a simple check on the validity of theoptions and issue warnings if the device and the file extension do notmatch, or the width and height for the pdf() device are greater than 100inches
demo(‘IBM’) to show IBM stock closing prices from 2000 to2010
ani.record() gained a new argument ‘replay.cur’, which can behelpful when we want to capture low-level plot changes without storingall the plots in memory (default behaviour of ani.record())
a new function saveVideo() to convert a sequence of images to avideo using FFmpeg (thanks, Thomas Julou)
we can easily create an animation using Rweb now; see a demo insystem.file(‘misc’, ‘Rweb’, ‘demo.html’, package = ‘animation’)
a new function qpdf() as a wrapper to the program ‘qpdf’, whichis mainly used to compress the PDF files (it is recommended overPdftk)
saveLatex() gained a new argument ‘full.path’: when the animationframes are not in the same directory with the LaTeX document, we can setfull.path = TRUE to ensure LaTeX can find the image files
grad.desc() gained two new arguments: ‘gr’ to provide thegradient function, and ‘main’ to specify to title of the plot (thanks,Zeno Adams)
clt.ani() gained two arguments ‘mean’ and ‘sd’ to draw thetheoretical limiting distribution
a new demo(‘ggobi_animation’) to show how to record GGobi plotsas an animation in the HTML file
saveSWF() puts all the image frames into the temp dir instead ofani.options(‘outdir’) (similar to saveGIF())
the location of the argument ‘img.name’ was moved to the 3rdplace in saveSWF() to be consistent to other saveXXX()functions
clt.ani() gained a new argument ‘xlim’ to set the x-axis limit ofthe histogram
knn.ani() gained the … argument to pass additional arguments tocreate the empty “frame” for the animation
demo(‘Xmas_card’) contributed by Yuan Huang
demo(‘flowers’) to show how to download images from the Internetand create an animation
a new function pdftk() as a wrapper to call the Pdftk toolkit(mainly for compressing PDF graphics output)
saveLatex(), saveSWF() and saveMovie() can compress the PDFgraphics using Pdftk (if available) now; if ani.options(‘ani.type’) is‘pdf’ and the ‘pdftk’ option is set, these functions will try thecompression first
new functions ani.record() and ani.replay() to record and replaythe animations; they can be used to capture the changes in the graphicsmade by low-level plotting commands (see ?ani.record forexamples)
a new demo ‘Xmas2’: Merry Christmas with snowflakes (seedemo(‘Xmas2’, ‘animation’); thanks, Jing Jiao)
a new function saveHTML() to insert animations into HTML pages(this was designed to replace the old ani.start() and ani.stop(); theoutput is much more appealing; the JavaScript is based on theSciAnimator library and jQuery)
ani.options() gained a new option ‘autoplay’ to indicate whetherto autoplay the animation in the HTML page created bysaveHTML()
in fact ani.options() was rewritten, but this should not have anyinfluence on users; the usage is the same
ani.options() gained a new option ‘use.dev’ to decide whether touse the graphics device provided in ani.options(‘ani.dev’) when callingsaveHTML(), saveLatex(), saveMovie() and saveSWF()
ani.options() has a couple of hidden options (‘convert’,‘swftools’, ‘img.fmt’) which can be useful too; see ?ani.options fordetails
a new function ani.pause(): it is a wrapper toSys.sleep(interval) but it will not pause when called in anon-interactive graphics device (usually the off-screen devices); thisis the recommended way to specify the pause in the animation now – allthe functions in this package have been adjusted to useani.pause()
a new demo(‘pollen’) to show the hidden ‘structure’ in a largedata (requires the rgl package)
a new demo(‘CLEvsLAL’) to `replay’ the NBA game between CLE andLAL on 2009 Christmas (with a new dataset ‘CLELAL09’)
a new demo(‘fireworks’) to set fireworks using R (thanks,Weicheng Zhu)
saveLatex() can work with the rgl package to produce 3Danimations in a PDF document now; see demo(‘rgl_animation’)
a new demo(‘rgl_animation’) to demonstrate how to insert rgl 3Danimations into a LaTeX document and compile to PDF
a new demo(‘use_Cairo’) to show how to use the Cairo device inthis package to obtain high-quality output
a new demo(‘Sweave_animation’) to show how to insert animationsinto Sweave documents
a new demo(‘game_of_life’) to demonstrate the (amusing) Game ofLife (thanks, Linlin Yan)
the documentation of this package has been tremendously revised;hopefully it is more clear to read now
several arguments in saveMovie(), im.convert(), saveSWF() andsaveLatex() were removed, because they can be specified byani.options(); this can simplify the usage of these functions
the argument ‘para’ in saveMovie() was removed; the argument‘ani.first’ was also removed from all the save*() functions, becausethis can be written in ‘expr’ and there is no need to provide anadditional argument
the path of the output in im.convert() and gm.convert() will bequoted, because sometimes users might supply a path containing spaces(thanks, Phalkun Chheng)
the option ‘filename’ in ani.options() was renamed to ‘htmlfile’so that the meaning of this option is more clear; ‘footer’ was renamedto ‘verbose’ too
ani.options() can accept any arguments now
im.convert() and gm.convert() will no longer stop() when theconvert utility cannot be found; instead, they only issue warnings; ahidden option ani.options(‘convert’) can be used to specify the locationof convert.exe in ImageMagick
saveMovie(), saveHTML(), saveSWF() and saveLatex() will try toopen the output if ani.options(‘autobrowse’) is TRUE; and they will keepthe current working directory untouched when evaluating ‘expr’(i.e. ‘expr’ will be evaluated under getwd())
the package has a NAMESPACE now (so .First.lib was changed to.onLoad accordingly)
im.convert() and gm.convert() can accept a vector of timeintervals now (i.e. the time interval between image frames does not haveto be a constant any more)
added a dataset ‘iatemp’ (yearly average temperature of centralIowa)
saveLatex() can be used in Sweave to dynamically insert PDFanimations now – it will automatically detect if it was called in Sweaveand output the relevant LaTeX code to the LaTeX document
the package is now maintained on GitHub(https://github.com/yihui/animation) and using roxygen to documentfunctions
the functions highlight.def(), write.rss() and tidy.source() weredefunct because they are irrelevant
ani.news() was removed from the package; we can use news(package= ‘animation’) instead
the MASS package is imported instead of being attached; in factonly lda() in MASS is used in the animation package.
fixed a buglet in saveMovie(): outdir does not actuallywork.
im.convert() will try to open the output using the defaultapplication in the OS (e.g. using command ‘xdg-open’, or‘open’)
demo(‘jumpingHorse’) shows a horse jumping on the chess board(contributed by Linlin Yan)
A new function im.convert() which comes from saveMovie() butserves as a more general- purpose function; it can convert a series offiles (not necessarily produced in R) to GIF/MPEG, and tries its best tofind ImageMagick automatically (even you only have LyX installed)Thanks, Kelvin Lam.
saveMovie() gained a new argument ‘fileext’ to specify the fileextension of the image frames (the old approach to get the file ext isnot appropriate if we use other graphics devices, e.g. Cairo);meanwhile, saveMovie() now uses im.convert() to convert images to ananimation file.
saveMovie() now generate the image frames in a temp directory andoutput the animation to the working directory by default (thanks, ThomasJulou)
demo(‘hanoi’) will demonstrate the Tower of Hanoi game(contributed by Linlin Yan)
A new function sample.ratio() to demonstrate the advantage ofratio estimation in sampling survey. (thanks, Amber Watkins)
added a note for the function newton.method() that the argument‘FUN’ needs to be defined without braces. (thanks, PeterEhlers)
fixed a bug in saveLatex(): the frame number should start with 0instead of 1. (thanks, Taiyun)
improved the way to find ‘convert’ for saveMovie() under Windowswhich is a long-lasting confusing problem for Windows users (thanks,Yishuo Deng)
fixed a bug caused by the ‘outdir’ option in ani.options() when‘outdir’ is a relative path which makes ani.stop() fail (thanks, PaulMurrell)
three demos to illustrate recursion added: seedemo(‘recur.leaf’), demo(‘recur.snow’) and demo(‘recur.tree’); thanks,Taiyun!
demo(‘Xmas’) added
fixed a bug for the option ‘interval’: in the non-interactiveenvironment, ani.start() and ani.stop() should useani.options()$interval to obtain the REAL ‘interval’ (other than0)
a new argument ‘install.animate’ for saveLatex() to install theLaTeX ‘animate’ if it does not exist
a new argument ‘width.cutoff’ for tidy.source() to decide thewidth of deparsed code
removed the code to install ImageMagick in saveMovie()
changed shell() to system() in saveMovie() (thanks, R. WoodrowSetzer)
updated the LaTeX package ‘animate’
a new function MC.hitormiss() to demonstrate the ‘hit or miss’Monte Carlo integration
a new function MC.samplemean() to demonstrate the ‘sample mean’Monte Carlo integration
a new function price.ani() to demonstrate the stock priceschanging within a time span (inspired by Shen Dai)
saveLatex() to embed the animation into a LaTeX document (withLaTeX package ‘animate’).
a new option ‘imgdir’ added to ani.options() so that users canspecify the name of the image directory
a message will come up if the animation option ‘nmax’ is changed;this will help users know the actual number of images in the currentsession; this message will only show in interactive mode
saveMovie() will try to install ImageMagick automatically if‘convert’ not found
query ani.options(‘interval’) will return 0 if the animation isrun in a non-interactive mode; this will save much time typically in ‘RCMD check’ (Thanks to Prof Ripley)
the option ‘nmax’ will be adjusted to theactual numberof images in the directory ani.options(‘imgdir’), because sometimes theactual number of images does not equal to ani.options(‘nmax’)
shortened the descriptions in Rd files and several changes indocumentations
fixed several buglets in ani.stop()
changed the ‘while’ loop to ‘for’ loop in brownian.motion(); thiswill shorten the code by two lines
ani.options(‘ani.dev’) can be the name of a function (character),e.g. “png”
moving.block() to plot a subset of data by blocks
ani.options() gained a new argument ‘loop’ to control theiteration of the animation in an HTML page: TRUE to interate forinfinite times, and FALSE not to interate (only play once). Thanks,Marcin Kozak!
new demo ‘Sierpinski’ for Sierpinski triangle; seedemo(Sierpinski).
ani.options(‘footer’) was changed to allow a custom string to bewritten in the HTML page as the footer information. (Thanks, JorgeNieves)
The famous ‘pollen’ data added. See the example for finding theletters hidden in the data.
A function quincunx() added to simulate the Galton box or BeanMachine. (Thanks for the inspiration from Roger Koenker)
A function least.squares() added to show the ordinary leastsquare process. (Thanks for the inspiration from DanielGoldstein)
A function BM.circle() added to show the Brownian Motion in acircle.
A function g.brownian.motion() added to demonstrate the BrownianMotion using Google Visulization API.
The Shapiro-Wilk normality tests are performed to independentsample means instead of the original ‘cumulative’ data. (Thanks, DuncanMurdoch)
Arguments ‘col.contour’ and ‘col.arrow’ added to grad.desc() tospecify the colors for the contour lines and arrows freely; thegraphical parameters are no longer specified within the function usingpar().
The path of SWF Tools in saveSWF() will be quoted by shQuote()instead of dQuote(). (Thanks, zhoulvjun)
The package has provided a wrapper to produce Flash animationsusing SWF Tools: saveSWF()
A demo ‘wordrotation’ added to show the basic method to makeanimations. More demos will be added in future releases.
ani.options() added to control animation parameters. It is muchbetter than ani.control() in previous versions.
ani.start() and ani.stop() are modified. The former functionopens a graphics device and the latter one create an HTML page with anew interface.
A wiki has been build to support this package:http://animation.yihui.org (AniWiki: Animations in Statistics)
Graphical parameters can be set in … argument for:brownian.motion(), buffon.needle(), clt.ani(), conf.int(), cv.ani(),lln.ani(), mwar.ani(), newton.method(), sample.cluster(),sample.strat().
P-values are computed in clt.ani() to check the normality (using‘shapiro.test()’).
The vignette is abandoned and stopped being updated; the wikihttp://animation.yihui.org will be used instead.
The way to create HTML animations is significantly changed forthe sake of a better interface and more flexible control of animations.Read the help files for ani.control(), ani.start(), ani.stop().
The function savePNG() removed. The new way to create animationframes allows ANY graphics devices.
ani.control() and checkargs() removed. The new way to controlanimation parameters is more flexible.
A rectangular grid has been added to the plot in kmeans.ani() sothat the moving of centers can be better observed.
The default value for the argument “source” is set to be“clipboard”.
conf.int() to illustrate the concept of confidenceintervals.
lln.ani() to illustrate the Law of Large Numbers.
grad.desc() for the Gradient Descent Algorithm.
bisection.method() for the illustration of the Bisectionmethod.
newton.method() for the demonstration of Newton-Raphsonmethod.
A special function checkargs() is added to validate animationarguments, which can promote the efficiency of animationfunctions.
It doesn’t need Sys.sleep() when creating HTML pages, so the codeis modified to avoid suspending in this case.
cli.ani() to illustrate the Centrol Limit Theorem (CLT).
vi.grid.illusion() to illustrate two kinds of grid illusions(Scintillating grid illusion and Hermann grid illusion).
write.rss() for creating RSS feed files from a CSV filecontaining RSS items.
vi.lilac.chaser() for the visual illusion ‘LilacChaser’.
The capability of PNG device is checked before creating png imagefiles in savePNG().
A bug in the assigning of ‘interval’ in the environment ‘ANIenv’was fixed.
A new function highlight.def() added to dynamically generate theR definition file for the software Highlight.
mwar.ani() to show moving window auto-regression.
sample.simple() for simple random sampling withoutreplacement.
sample.strat() for stratified sampling.
sample.cluster for cluster sampling.
sample.system() for systematic sampling.
The string ‘file://’ was added before the path of the HTMLanimation page to avoid the error caused by browseURL inani.stop().
File ‘ANI.css’ and ‘FUN.js’ were moved to the directory ‘js’(because they are not ‘data’). Both files were modifiedslightly.
The parameter for time interval can be passed to the HTMLanimation page now.
The vignette was supplemented and modified accordingly.
An argument ‘col’ added to flip.coin() to control colors of eachface of the coin.
The ‘pageview’ data updated to Dec 3, 2007.
Points that have already been classified in knn.ani() are markedout in later steps of classification for the rest points.
The values of PI are silently returned inbuffon.needle().
The result for the test set can be returned inknn.ani().
The computation for kfcv() is changed so that the sample sizeswill be more ‘uniformly’ allocated.
A new function ani.control() added so that the controllingparameters can be more uniform and the scalability of the animationfunctions will also be better. All the animation functions are chanagedaccordingly.
A news-reading function ani.news() added so that changes will beconveniently known.
boot.iid() is available for demonstration of bootstrapping i.i.ddata.
The arguments … is added in animation functions to control PNGimage files.
The sample data is permuted before cv.ani() so that every time wedo cross-validation, the splitting of trainig set and test set willchange (instead of splitting 1:n into k parts). The tick marks of x-axiswill change accordingly.
ani.start() to start an HTML page for animations.
ani.stop() to complete the HTML animation page.
brownian.motion() to demonstrate Brownian motion in the 2Dplane.
buffon.needle() to simulate the process of Buffon’sneedle.
cv.ani() to demonstrate k-fold cross validation.
flip.coin() to simulate tossing ‘coins’.
kfcv() to compute sample sizes for k-foldcross-validation.
kmeans.ani() to show the process of K-Means clusteranalysis.
knn.ani() to show k-Nearest Neighbor algorithm.
savePNG() to save PNG image files which constitute the basicanimation frames in the HTML page.
tidy.source() is a trivial function to ‘tidy up’ R code using theinternal R function parse().
‘pageview’ is a daily page view data of my personalwebsite.