Skip to content

Instantly share code, notes, and snippets.

@yihui
Last active July 13, 2017 20:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save yihui/5899181 to your computer and use it in GitHub Desktop.
Save yihui/5899181 to your computer and use it in GitHub Desktop.
create and download a GIF animation in Shiny
library(animation)
stopifnot(packageVersion('animation') >= '2.2.3')
shinyServer(function(input, output) {
output$testgif = downloadHandler(
filename = 'random.gif',
content = function(file) {
saveGIF(
for (i in 1:30) {
plot(rnorm(100))
}, movie.name = 'random.gif', interval = 0.1)
file.rename('random.gif', file)
})
})
library(shiny)
shinyUI(basicPage(
downloadButton("testgif")
))
@ian-flores
Copy link

I have the same issue as kmezhoud.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment