作者tokyo291 (工口工口)
看板R_Language
标题[问题] 使用animation 需要安装ImageMagick
时间Tue Nov 11 01:33:24 2014
[问题类型]:
程式谘询
[软体熟悉度]:
使用者(已经有用R 做过不少作品)
[问题叙述]:
想把plot的动态图形存成GIF档,使用animation这个package
出现错误讯息,查了之後,执行这个结果需要安装ImageMagick
在下列网址可以找到安装档
http://www.imagemagick.org/script/binary-releases.php
安装完之後,成功一次转出GIF档
在一次执行时就转不出来了...
[程式范例]:
> saveGIF({
+ for (i in 1:10) plot(runif(10), ylim = 0:1)
+ })
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' 不是内部或外部命令、可执行的程式或批次档。
参数无效 - 0
an error occurred in the conversion... see Notes in ?im.convert
[1] FALSE
警告讯息:
1: 执行中命令 '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"' 已有状态 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: 执行中命令 '"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"' 已有状态 4
4: In normalizePath(path.expand(path), winslash, mustWork) :
path[1]="animation.gif": 系统找不到指定的档案。
[关键字]:
animation/ImageMagick/saveGIF
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 114.39.225.189
※ 文章网址: http://webptt.com/cn.aspx?n=bbs/R_Language/M.1415640808.A.042.html
※ 编辑: tokyo291 (114.39.225.189), 11/11/2014 02:19:44
1F:→ andrew43: 要不要直接从terminal直接下convert命令看看? 11/11 02:42
2F:→ andrew43: 因为我猜是该package的问题。 11/11 02:43
3F:→ tokyo291: 请问要怎麽操作"terminal下convert"这个步骤呢? 11/11 10:09
4F:→ andrew43: 我的意思是自己做出 PNG 再自己转成 GIF。 11/11 18:21
6F:→ andrew43: 当然,前题是你的 imagemagick 都安装好路径设好才行。 11/11 18:22
7F:→ andrew43: 语说回来,你提出的例子,大概不必要靠 package。 11/11 18:23
8F:→ andrew43: 所以我才觉得自己做就行了。 11/11 18:23