I'm having trouble with the SaveGIF function in library (animation). The function gives me this error:
Error in cmd.fun(sprintf("%s --version", convert), intern = TRUE, ignore.stdout = !interactive(), :
unused argument(s) (ignore.stdout = !interactive())
I cannot find ImageMagick with convert = 'convert'
NULL
Warning message:
In im.convert(img.files, output = movie.name, convert = convert, :
Please install ImageMagick first or put its bin path into the system PATH variable
What confuses me is that I do have convert on my system, so I'd expect SaveGIF to be able to find it without any trouble:
me@my-laptop:~$ convert --version
Version: ImageMagick 6.5.7-8 2010-12-02 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009
How do I add convert's bin path to the system PATH variable?
Edit: I'm using Ubuntu, not Windows.
You probably did not edit your PATH variable. On Windows 7 (but will probably work on earlier versions to) go to:
start menu
Right click computer -> properties
Advanced System Settings
Environment Variables
Then under "System variables" (the lower pane) find the variable "path", select it and click edit.
You are interested in the content of Variable value (maybe copy it to a text editor to read it better). It should contain the link to imagemagick in it, seperated by semicolons from other variables. For me the path to imagemagick is:
C:\Program Files\ImageMagick-6.6.7-Q16
Make sure you only add it, not change anything else to the path variable. Add it with a semicolon.
After attempting all of these fixes as well as these and these to no success, I used alternative software to make the conversion from the png files that were successfully created with
saveHTML
. Several programs are described here. I am a Windows user and found the simple instructions contained in that site for VirtualDub quickly accomplished this task.You can find where your convert function lives with
system("which convert", intern=TRUE)
and then you (may be able to) add that to your PATH variable withSys.setenv(PATH=...)
Usually we do not need to manually set the PATH variable under Linux. I'm using Ubuntu as well, but I cannot reproduce your error. What's your R version?
As far as I can see, the error comes from the function
system()
instead of not being able to findconvert
. The argumentignore.stdout
came in R 2.12.1, so you must be using a lower version of R. The current version is 2.13.0, and I recommend you to upgrade to the latest version. See http://cran.r-project.org/bin/linux/ubuntu/ for how to keep R updated with CRAN.