title: How do I save a GIF image from the animate function in R?
body: <p>I am using the animate function in R to successfully create the animation I require and it is displayed perfectly. However, I cannot save the output (called TodayMotion in the code example below) in a file (such as a Gif89a) so that I can distribute/store the animation. It sounds a simple problem but I have been unable to solve it. </p>
  
  <p>I have attempted a wide range of solutions including the ImageMagick package which cannot load on my version of R. Also save.gif and the Magick package's write command, it says it does not recognise the file. And just to clarify I have tried 'magick::image_write(TodayMotion, path="magicksaveOption.gif")' &amp; 'anim_save("TodayMotion.gif", TodayMotion)' and neither work.</p>
  
  <pre><code>ggm &lt;- ggmap(UK) +
  geom_point(data = Origin1,
  aes(x = Long, y = Lat,
  colour = group),
  size = 2, alpha = 0.8) +
  transition_time(time) +
  shadow_wake(wake_length = .1)
  
  
  TodayMotion &lt;&lt;- animate(ggm, height = 1500, width = 1500, fps = 
  20, duration = 20, start_pause = 10, end_pause = 20,  rewind = T)
  </code></pre>
  
  <p>PS. in the environment TodayMotion is described as a "class gif_image"</p>
  
  <p>I would like to end up with a saved gif (gif89a as it is animated) in my desired directory. (the image below is captured from the screen)</p>
  
  <p><a href="https://i.stack.imgur.com/tyA8G.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tyA8G.jpg" alt="enter image description here"></a></p>