Reputation: 61
I want to use ImageMagick in R, but R won't let me install it.
install.packages("ImageMagick")
Installing package into ‘C:/Users/FSFH-2/Documents/R/win-library/3.0’
(as ‘lib’ is unspecified)
Warning message:
package ‘ImageMagick’ is not available (for R version 3.0.1)
I'm under the impression that I have the latest version of R, so what's going on here?
Additionally, I downloaded ImageMagick into windows, but I can't figure out how to get it into R. Help!
Upvotes: 6
Views: 27960
Reputation: 795
Just follow the link Link to download and install ImageMagick on Windows. After that, type your command (like convert ...) in cmd.exe to verify that ImageMagick does exist. At this time, I know that we can only use it in cmd.exe, not in R.
Upvotes: 2
Reputation: 2280
you need to install a package named "installr" prior to installing ImageMagick.
Simple Steps:
require(installr)
install.ImageMagick()
(This command will by default install the latest version, u can specify the URl of the version needed)The package will be installed !!!
Upvotes: 14
Reputation: 1
If you are on Mac, what just worked for me was to use port in Terminal.
I installed ImageMagick, and then I had to install animation in R itself.
In terminal:
sudo port install ImageMagick
... it installs a few package dependencies and finishes up.
In the R studio afterwards:
install.packages("animation")
and then check by running following example:
saveGIF({
for (i in 1:10) plot(runif(10), ylim = 0:1)
})
if the above conversion was successful, the option 'convert' should not be NULL
Upvotes: 0
Reputation: 42283
There is now a package magick that wraps around the ImageMagick STL.
It can be installed simply with install.packages("magick")
There is a blog post explaining what you can do with it here: https://ropensci.org/blog/2016/08/23/z-magick-release
Upvotes: 13
Reputation: 19
I used these commands in RStudio.
It installed the latest version of ImageMagick.
Upvotes: 1
Reputation: 2874
If you are on Mac, what just worked for me was to use Homebrew in Terminal (if you don't have homebrew or anything similar, get it!).
I installed ImageMagick, and then I had to install animation in R itself.
In terminal:
sudo brew install ImageMagick
... it installs a few package dependencies and finishes up.
In the R console afterwards (in R, Rstudio, Emacs, ...):
install.packages("animation")
Now try ?gganimate
and run the examples at the bottom to test it out!
The examples in the help file worked without problem for me. This works within Rstudio very fluidly, Rstudio being written just as a web-browser is under the hood. I personally use ESS within Emacs, which for plotting usually opens an X11 (or Quartz) window. Using gg_animate
, however, opens a browser by default and displays the output there.
Upvotes: 2
Reputation: 5366
If you're using Mac OS or Linux, you can install ImageMagick on your system and then use it from within R using the system() function. I don't know if ImageMagick works with Windows.
Upvotes: 0