错误saveGIF命令动画包 [英] error in saveGIF command in animation package

查看:854
本文介绍了错误saveGIF命令动画包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用首次动画包在R上。

I'm trying to use for the first time animation package in R.

我用这个简单的code:

I'm using this simple code:

saveGIF({
    for (i in 1:10) plot(runif(10), ylim = 0:1)
})

但-r显示此错误(即我在英文翻译):

But R shows this error (that i've translated in english):

Executing: 
"convert" -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"
"convert" -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" is not recognized like an internal or external command,
 an executable program or batch file.
Parameter not valid - 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" -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" -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" -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 
4: In normalizePath(path.expand(path), winslash, mustWork) :
  path[1]="animation.gif": Impossible to find the file specified

问题出在哪里?

推荐答案

研究找不到转换可执行文件。你必须指定它的使用完整路径和名称 ani.option()

R cannot find the convert executable. You have to specify it's full path and name using ani.option()

ani.options(convert = 'C:\\Program Files\\ImageMagick-6.9.0-Q16\\convert.exe')

(您可能需要修改C:\\ Program Files文件\\的ImageMagick-6.9.0-Q16 \\')

(You may have to modify the 'C:\Program Files\ImageMagick-6.9.0-Q16\')

这篇关于错误saveGIF命令动画包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆