How can I display GIF in R shiny

24 views
Skip to first unread message

Sj Z

unread,
Dec 11, 2017, 1:24:53 AM12/11/17
to Shiny - Web Framework for R
I have a function using savegif to generate gif in my space. But how can I display this gif in the Shiny? I have tried read.gif, but it does not work. Could someone help me? 

Thanks!

Code:

        mainPanel(
       imageOutput('animated_image')
      )
    )
  ),
  server = function(input, output, session)
  {
    observeEvent(input$go,{
      saveGIF(plotfire(State, year, month), movie.name = paste0(input$State,input$year,input$month,'.gif'))
      }
      )
    

    
    output$animated_image <- renderImage({
      input$go
      filename <- paste0(input$State,input$year,input$month,'.gif')
      list(src=filename)
    }, deleteFile = FALSE)
Reply all
Reply to author
Forward
0 new messages