Cannot find 'convert' using SaveGIF function in animation package

前端 未结 4 1407
自闭症患者
自闭症患者 2020-12-21 05:57

I\'m having trouble with the SaveGIF function in library (animation). The function gives me this error:

Error in cmd.fun(sprintf("%s --version"

相关标签:
4条回答
  • 2020-12-21 06:10

    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 with

    Sys.setenv(PATH=...)

    0 讨论(0)
  • 2020-12-21 06:28

    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.

    0 讨论(0)
  • 2020-12-21 06:33

    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?

    > sessionInfo()
    R version 2.13.0 (2011-04-13)
    Platform: x86_64-pc-linux-gnu (64-bit)
    
    locale:
     [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
     [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
     [5] LC_MONETARY=C              LC_MESSAGES=en_US.UTF-8   
     [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
     [9] LC_ADDRESS=C               LC_TELEPHONE=C            
    [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
    
    attached base packages:
    [1] stats     graphics  grDevices utils     datasets  methods   base     
    
    other attached packages:
    [1] animation_2.0-4    
    

    As far as I can see, the error comes from the function system() instead of not being able to find convert. The argument ignore.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.

    0 讨论(0)
  • 2020-12-21 06:33

    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.

    0 讨论(0)
提交回复
热议问题