错误从研发运行ImageMagick的无效参数: [英] Error running ImageMagick from R: Invalid parameter

查看:1126
本文介绍了错误从研发运行ImageMagick的无效参数:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使R的GIF动画我有我想转换成GIF动画矩阵阵列。我的策略是从这个例子启发:

I am trying to make a GIF-animation in R. I have an array of matrices which i wish to convert into a GIF animation. My strategy is inspired from this example:

<一个href=\"http://ryouready.word$p$pss.com/2010/11/21/animate-gif-images-in-r-imagemagick/\">http://ryouready.word$p$pss.com/2010/11/21/animate-gif-images-in-r-imagemagick/

,其中以下code产生11 PNG图像与R.下一步PNG - 函数调用外部ImageMagick的节目转换编译GIF动画。

where the following code produces 11 PNG-Pictures with the "png"-function in R. Next it calls for the external ImageMagick-program "convert" to compile the GIF animation.

dir.create("examples")
setwd("examples")

# Animated countdown from 10 to "GO!".
png(file="example%02d.png", width=200, height=200)
for (i in c(10:1, "G0!")){
plot.new()
text(.5, .5, i, cex = 6)
}
dev.off()

# convert the .png files to one .gif file using ImageMagick. 
system("convert -delay 80 *.png example_1.gif")
#shell("convert -delay 80 *.png example_1.gif")

问题是的R似乎并不FINDE的EXE文件转换这是ImageMagick的的一部分,安装在C-驱动器(C:\\ Program Files文件\\的ImageMagick-6.8.5-Q16)。在评论的网站我正在链接到前面,建议Windows用户使用的壳,而不是系统运行外部程序,但两者的工作没有。该错误消息

The problem is that R doesn't seem to finde the exe-file "convert" which is a part of ImageMagick and installed on the C-drive (C:\Program Files\ImageMagick-6.8.5-Q16). In the comments to the website i am linking to earlier, it is suggested for Windows users to use "shell" instead of "system" to run external programs but none of the two work. The error message is

Invalid parameter - 80
Warning message:
running command 'convert -delay 80 *.png example_1.gif' had status 4

我试图更改Windows PATH环境变量中的系统性能,如本<建议href=\"http://stackoverflow.com/questions/6132332/help-with-savegif-function-in-libraryanimation/6135579#6135579\" title=\"http://stackoverflow.com/questions/6132332/help-with-savegif-function-in-libraryanimation/6135579#6135579\">answer,但PATH变量是allready corectlly我的系统上进行定义。我也试过指定CONVERT.EXE文件的整个字符串,也没有运气...

I've tried to change the Windows PATH enviroment variable in the systems properties, as suggested in this answer, but the PATH-variable was allready corectlly defined on my system. I also tried specifying the whole string of the convert.exe file, but also without luck...

我怎样才能到ImageMagick的过R跑?

How can i get ImageMagick to run through R?

规格:
Windows 7的服务包1,
- [R 3.0.0

Specs: Windows 7 Servicepack 1, R 3.0.0

在此先感谢...

推荐答案

在Windows中,有几个CONVERT.EXE命令,所有这一切都是在PATH中。所以,你必须指定路径向右CONVERT.EXE可执行文件。就我而言,我是有在LyX的文件夹(但是,您将在ImageMagick的安装嫌弃)。
小心引号,反斜杠,如果你正在粘贴的间距。例如。从研发中:

On Windows, there are several convert.exe commands, all of which are in the PATH. So you must specify the path to the right convert.exe executable. In my case, I had it in the LyX folder (however, you will find it in the ImageMagick installation too). Be careful with the quotes, the backslashes and the spacing if you are pasting. E.g. from within R:

system('"C:\\Program Files (x86)\\LyX 2.0\\imagemagick\\convert.exe" -delay 20 -loop 0 files_*.png animation.gif')

这篇关于错误从研发运行ImageMagick的无效参数:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆