2015-03-09 4 views
2

Пробовал запустить следующий код в R:Ошибка с помощью анимации пакета R

ani.options(
    convert = shQuote("C:/Program Files/ImageMagick-6.9.0-Q16/convert.exe") 
) 
saveGIF(
{ 
    for (i in 1:10) plot(runif(10), ylim = 0:1) 
}, 
movie.name = "test.gif", 
interval = 0.2, 
ani.width = 300, 
ani.height = 300, 
outdir = getwd() 
) 

Получение сообщение об ошибке:

Executing: 
"\"C:/Program Files/ImageMagick-6.9.0-Q16/convert.exe\"" -loop 0 -delay 20  Rplot1.png Rplot2.png Rplot3.png 
Rplot4.png Rplot5.png Rplot6.png Rplot7.png Rplot8.png Rplot9.png Rplot10.png "test.gif" 
The filename, directory name, or volume label syntax is incorrect. 
an error occurred in the conversion... see Notes in ?im.convert 
[1] FALSE 
Warning messages: 
1: running command 'C:\Windows\system32\cmd.exe /c "\"C:/Program  Files/ImageMagick-6.9.0-Q16/convert.exe\"" --version' had status 1 
2: running command 'C:\Windows\system32\cmd.exe /c "\"C:/Program Files/ImageMagick-6.9.0-Q16/convert.exe\"" -loop 0 -delay 20 Rplot1.png Rplot2.png Rplot3.png Rplot4.png Rplot5.png Rplot6.png Rplot7.png Rplot8.png Rplot9.png Rplot10.png "test.gif"' had status 1 
3: In cmd.fun(convert) : 
    '"\"C:/Program Files/ImageMagick-6.9.0-Q16/convert.exe\"" -loop 0 -delay 20 Rplot1.png Rplot2.png Rplot3.png Rplot4.png Rplot5.png Rplot6.png Rplot7.png Rplot8.png Rplot9.png Rplot10.png "test.gif"' execution failed with error code 1 
4: running command '"\"C:/Program Files/ImageMagick-6.9.0-Q16/convert.exe\"" -loop 0 -delay 20 Rplot1.png Rplot2.png Rplot3.png Rplot4.png Rplot5.png  Rplot6.png Rplot7.png Rplot8.png Rplot9.png Rplot10.png "test.gif"' had status 127 

Может кто-то пожалуйста, указать на мою ошибку.

+0

не забудьте' печати ' – Khashaa

ответ

1

У меня была такая же проблема, и, похоже, это из-за пути конвертировать. Если я типа:

ani.options (конвертировать = shQuote ('C:/Program Files/ImageMagick-6.8.7-Q16/convert.exe'))

А затем проверьте путь

ani.options ("преобразования") [1] "\" C:/Program Files/ImageMagick-6.8.7-Q16/convert.exe \ ""

Однако, я е я:

ani.options (конвертировать = 'C:/Program Files/ImageMagick-6.8.7-Q16/convert.exe') ani.options ("преобразования") [1] " C:/Program Files/ImageMagick-6.8.7-Q16/convert.exe»

это правильный путь и saveGIF работает .... странные вещи ...

Смежные вопросы