movies

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

ぐ巨炮叔叔 提交于 2019-11-26 08:45:23
问题 Is there an easy way to create a \"movie\" by stitching together several plots, within R? 回答1: Here is one method I found using R help: To create the individual image frames: jpeg("/tmp/foo%02d.jpg") for (i in 1:5) { my.plot(i) } dev.off() To make the movie, first install ImageMagick. Then call the following function (which calls "convert", part of ImageMagick I suppose): make.mov <- function(){ unlink("plot.mpg") system("convert -delay 0.5 plot*.jpg plot.mpg") } Or try using the ffmpeg