Making animated gifs using R [duplicate]

2019-03-28 12:52发布

问题:

This question already has an answer here:

  • Creating a Movie from a Series of Plots in R [closed] 7 answers

Does anyone have any tips regarding making animated GIFs in R? I'm trying to make some time lapse map GIFs.

回答1:

Repeat Question : Please see this previous StackOverflow question on creating a series of plots in R which offers a number of solutions including pointers to other useful packages such as the animation package.



回答2:

Also be sure to check out the animation package



回答3:

I'd recommend just generating a series of png files (which happens by default each time you run plot with the png device open). You can then combine them into an animated gif with another program such as ImageMagick.



回答4:

Here is sample code of using Imagemagick (called through R) for any sequence of png's you generate.