带有ImageMagick的R GIF动画

带有ImageMagick的R GIF动画,r,animation,imagemagick,R,Animation,Imagemagick,我已经在谷歌上搜索了一个多小时,尝试了我在这个话题上找到的一切。 我正试图借助动画软件包在R中制作一个情节动画: library(animation) saveGIF({ for(i in 1:10) { plot(x=rnorm(10),y=rnorm(10)) } }) 这会产生以下错误: Executing: "convert.exe" -loop 0 -delay 100 Rplot1.png Rplot2.png Rplot3.png Rplot4.png Rplo

我已经在谷歌上搜索了一个多小时,尝试了我在这个话题上找到的一切。 我正试图借助动画软件包在R中制作一个情节动画:

library(animation)
saveGIF({
for(i in 1:10) {
    plot(x=rnorm(10),y=rnorm(10))
}
})
这会产生以下错误:

Executing: 
"convert.exe" -loop 0 -delay 100 Rplot1.png Rplot2.png Rplot3.png     Rplot4.png Rplot5.png Rplot6.png Rplot7.png Rplot8.png Rplot9.png Rplot10.png
"animation.gif"
Der Befehl "convert.exe" -loop 0  -delay 100 Rplot1.png Rplot2.png     Rplot3.png Rplot4.png Rplot5.png Rplot6.png Rplot7.png Rplot8.png Rplot9.png Rplot10.png "animation.gif" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
Unzul„ssiger Parameter - 0
an error occurred in the conversion... see Notes in ?im.convert
[1] FALSE
Warning messages:
1: running command 'C:\WINDOWS\system32\cmd.exe /c "convert.exe" -loop 0  -delay 100 Rplot1.png Rplot2.png Rplot3.png Rplot4.png Rplot5.png Rplot6.png Rplot7.png Rplot8.png Rplot9.png Rplot10.png "animation.gif"' had status 1 
2: In cmd.fun(convert) :
'"convert.exe" -loop 0  -delay 100 Rplot1.png Rplot2.png Rplot3.png Rplot4.png Rplot5.png Rplot6.png Rplot7.png Rplot8.png Rplot9.png Rplot10.png "animation.gif"' execution failed with error code 1 
3: running command '"convert.exe" -loop 0  -delay 100 Rplot1.png Rplot2.png Rplot3.png Rplot4.png Rplot5.png Rplot6.png Rplot7.png Rplot8.png Rplot9.png Rplot10.png "animation.gif"' had status 4 
我已经检查了系统路径变量

Sys.getenv('PATH')
"C:/Program Files/R\\R-3.0.2\\bin\\x64;C:\\Program Files (x86)\\ImageMagick-6.9.0-Q16;C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\ProgramData\\Oracle\\Java\\javapath;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;F:\\Program Files (x86)\\MATLAB\\R2014a\\bin;C:\\Program Files (x86)\\MiKTeX 2.9\\miktex\\bin\\;C:\\Users\\Maddin\\AppData\\Local\\Pandoc\\"
我尝试了64位和32位版本的ImageMagick。 我尝试手动设置ani.options convert属性。没有任何帮助。 当我打开命令行工具并测试convert.exe是否工作时,一切正常。但是从R里面,我就是不能让它工作-

有趣的事实:在我的MacBook上,它工作得完美无缺

这是我的sessionInfo():

有人知道我还能尝试什么吗


马丁我经历过这个错误。我没有一个完美的解决方案,但你可以尝试安装“动画”软件包的开发版本,它不再返回错误

library(devtools)
install_github("yihui/animation")

最近,我们修复了im.convert()函数中的一个bug,您可以检查。 我在笔记本电脑上测试了新的im.convert()函数(带有Revolution R的Windows Vista)。似乎saveGIF()函数在更新到开发版本动画包后运行良好。 有人能帮我测试一下你是否能用开发版本成功保存GIF吗

下面是一些测试代码

install.packages("devtools")
library(devtools)

dev_mode(on=T)

install.packages('animation', repos = 'http://yihui.name/xran')
library(animation)
saveGIF({
    for (i in 1:10) plot(runif(10), ylim = 0:1)
})

dev_mode(on=F)

我想,但我无法下载该版本的动画:安装中的警告。软件包:软件包“yihui/animation”不可用(适用于R版本3.2.2)curl:(22)请求的URL返回错误:404未找到我在上载软件包的开发版本,只需单击“原始”按钮,即可下载。然后尝试安装本地包,
library(“devtools”);安装本地(“animation_2.4.1.tar.gz”)
谢谢。我将研究:)我在OS X 10.11.1上使用
R 3.2.2
ImageMagick 6.9.2-8 Q16 x86_64 2015-12-06
时没有遇到任何问题。我用不同的绘图系统和文件格式尝试了不同的动画。感谢您的测试和反馈!
install.packages("devtools")
library(devtools)

dev_mode(on=T)

install.packages('animation', repos = 'http://yihui.name/xran')
library(animation)
saveGIF({
    for (i in 1:10) plot(runif(10), ylim = 0:1)
})

dev_mode(on=F)