You may have to install the development version of the animation package from Github: https://github.com/yihui/animation#readme
Last active
July 13, 2017 20:53
-
-
Save yihui/5899181 to your computer and use it in GitHub Desktop.
create and download a GIF animation in Shiny
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
}) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
shinyUI(basicPage( | |
downloadButton("testgif") | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I just tried to save coffeewheel (https://github.com/armish/coffeewheel) as gif file.
animation needs ImageMagick?
Thanks
sh: convert: command not found
Error in cmd.fun(sprintf("%s --version", convert), intern = TRUE) :
error in running command
I cannot find ImageMagick with convert = 'convert'
Warning in run(timeoutMs) :
Please install ImageMagick first or put its bin path into the system PATH variable
Warning in run(timeoutMs) :
path[1]="animation.gif": No such file or directory
Error opening file: 2
Error reading: 9