パッケージ 'animation'にsaveGIF関数を使用しようとしていました。必要な外部ソフトウェアImageMagickをインストールしました。次のようにトライアルコードは次のとおりです。saveGIFを使用してRでアニメーションを作成
library(animation)
ani.options(convert = 'C:\\Program Files\\ImageMagick-7.0.6-Q16\\convert.exe')
saveGIF({
for (i in 1:10) plot(runif(10), ylim = 0:1)
})
をしかし、それは次のエラー得られます?
Executing:
"C:\Program Files\ImageMagick-7.0.6-Q16\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""
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
an error occurred in the conversion... see Notes in ?im.convert
Warning messages:
1: running command 'C:\WINDOWS\system32\cmd.exe /c "C:\Program Files\ImageMagick-7.0.6-Q16\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) :
'"C:\Program Files\ImageMagick-7.0.6-Q16\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 '"C:\Program Files\ImageMagick-7.0.6-Q16\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 127
にノートからメモを
ImageMagick users Please install ImageMagick from http://www.imagemagick.org , and make sure the the path to convert.exe is in your 'PATH' variable, in which case the commandconvert can be called without the full path. Windows users are often very confused about the ImageMagick and 'PATH' setting, so I'll try to search for ImageMagick in the Registry Hive by readRegistry('SOFTWARE\ImageMagick\Current')$BinPath, thus you might not really need to modify your 'PATH' variable. For Windows users who have installed LyX, I will also try to find the convert utility in the LyX installation directory, so they do not really have to install ImageMagick if LyX exists in their system (of course, the LyX should be installed with ImageMagick). Once the convert utility is found, the animation option 'convert' will be set (ani.options(convert = 'path/to/convert.exe')); this can save time for searching for convert in the operating system next time.
が、それは間違っている私ですim.convert convert.exeへのパスがPATH変数にない場合、convert.exeに完全なdirを指定する必要があるということを理解できますか?
設定に何か問題がありますかconvert.exeを呼びますか?
あなたのコードは、 'C:\\ Program Files \\ ImageMagick-7.0.6-Q16 \\ convert.exe'というパスが正しいかどうかを慎重にチェックしてください。 –
私はLinux上にいるので、これをテストすることはできませんが、Windowsではスペースを含むパスを引用符で囲む必要があると思います。 '' Ani.options(convert = "'C:\\ Program Files \\ ImageMagick-7.0.6-Q16 \\ convert.exe'") ' – dww
Marco Sandri、はい、convert.exeへのこのパスは本当に正しいです。これもデフォルトのインストールディレクトリです。 – Gamp