0

I have some images saved on my computer, I would like to create a gif using RStudio and later save it on my computer. I do not know where to start.

Phil
  • 7,287
  • 3
  • 36
  • 66
  • This question is a bit vague for SO, I believe. Start here: https://stackoverflow.com/questions/1384403/making-animated-gifs-using-r – TTS Jul 22 '20 at 16:36
  • [Here](https://www.google.com/search?q=create+gif+in+r&sxsrf=ALeKk01p4aSBczerXpUQBwxCvChNgKA12w%3A1595435696291&source=lnt&tbs=cdr%3A1%2Ccd_min%3A1%2F1%2F2017%2Ccd_max%3A7%2F30%2F2020&tbm=) are a number of places to look. – eipi10 Jul 22 '20 at 16:36
  • OP, if you just have a collection of images you want to turn into a gif, is there any particular reason why you would not use any of the free online tools for generating gifs or other image-editing software? R is more suitable when you have data and you want to use that to generate a collection of images/plots/tables based on that data. – chemdork123 Jul 22 '20 at 17:31

1 Answers1

0

If the images are in png format, this will work:

png_files <- list.files(path = ".", pattern = ".png", full.names = TRUE)
gifski::gifski(png_files, gif_file = "animation.gif")
JBGruber
  • 11,727
  • 1
  • 23
  • 45