问题描述
我已经一个多小时,现在用Google搜索,并试图一切我关于该主题中。
我试图动画中的R剧情与动画包的帮助:
I've googled for over an hour now and tried everything I found on that topic.I am trying to animate a plot in R with the help of the animation package:
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
我已经检查了系统路径变量
I already checked the system path variable
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\\"
我都尝试的ImageMagick的64位和32位版本。
我尝试设置ani.options手动转换属性。没有什么帮助。
当我打开命令行工具和测试,如果CONVERT.EXE工作,万物的罚款。但是,从内部R I只是不得到它的工作-.-
I tried both the 64-bit and 32-bit versions of ImageMagick.I tried setting the ani.options convert attribute manually. Nothing helped.When I open the command line tool and test if convert.exe works, everythings fine. But from inside R I just dont get it to work -.-
有趣的是我的MacBook及其工作完美无瑕......
Fun fact: on my MacBook its working flawless.....
下面是我的sessionInfo():
Here is my sessionInfo():
R version 3.0.2 (2013-09-25)
Platform: x86_64-w64-mingw32/x64 (64-bit)
locale:
[1] LC_COLLATE=German_Germany.1252 LC_CTYPE=German_Germany.1252 LC_MONETARY=German_Germany.1252 LC_NUMERIC=C LC_TIME=German_Germany.1252
attached base packages:
[1] grid stats graphics grDevices utils datasets methods base
other attached packages:
[1] ggplot2_1.0.0 animation_2.3 dplyr_0.2 magrittr_1.5
loaded via a namespace (and not attached):
[1] assertthat_0.1 colorspace_1.2-4 digest_0.6.4 gtable_0.1.2 lattice_0.20-29 lmtest_0.9-33 MASS_7.3-33 munsell_0.4.2 parallel_3.0.2
[10] plyr_1.8.1 proto_0.3-10 Rcpp_0.11.3 reshape2_1.4 sandwich_2.3-2 scales_0.2.4 stringr_0.6.2 tools_3.0.2 urca_1.2-8
[19] vars_1.5-2 zoo_1.7-11
任何一个想法,还有什么我能试试吗?
Anyone an idea what else I could try?
马丁
推荐答案
近日,我们在修复一个bug的 im.convert()功能,您可以检查的。
我在我的笔记本电脑(Windows Vista中革命R)测试了新的im.convert()函数。似乎saveGIF()函数更新到开发版动画包好后的作品。
会有人可以帮我测试,如果你能成功地保存GIF与开发版?
Recently, we fix a bug in im.convert() function, you can check issue #71 .I tested the new im.convert() function on my laptop( Windows Vista with Revolution R). It seems that saveGIF() function works well after updating to the development version animation package.Would anyone can help me to test if you can save GIF successfully with the development version?
下面是一些测试code。
Here are some testing code.
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)
这篇关于 - [R GIF动画与ImageMagick的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!