我已经谷歌了一个多小时,尝试了所有与此主题相关的内容。我正在尝试使用动画包在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\\"
我尝试过ImageMagick的64位和32位版本。我尝试手动设置ani.options转换属性,但没有效果。当我打开命令行工具并测试convert.exe时,一切正常。但是从R内部无法使其工作。有趣的是,在我的MacBook上它运行得非常好......这是我的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
请问还有什么其他的尝试方法吗?
Martin
library("devtools"); install_local("animation_2.4.1.tar.gz")
。 - Lijia YuR 3.2.2
和ImageMagick 6.9.2-8 Q16 x86_64 2015-12-06
时,在OS X 10.11.1上没有遇到任何问题。我尝试了不同的动画效果,使用了不同的绘图系统和文件格式。 - Martin Schmelzer