6

I simply want to render a .gif file in an R shiny app. Is there a simple way to do this? I was unable to find a solution in the documentation.

hmukhe
  • 75
  • 1
  • 5
  • Check out the "pre-rendered" section of https://shiny.rstudio.com/articles/images.html – MrFlick Apr 18 '20 at 05:17
  • Maybe check this out as well: https://stackoverflow.com/questions/38011285/image-not-showing-in-shiny-app-r/46546344#46546344 – MrFlick Apr 18 '20 at 05:19

1 Answers1

9

Try this:

library(shiny)

ui <- fluidPage(
  img(src="sample.gif", align = "left",height='250px',width='500px')
)

server <- function(input, output, session) {

}

shinyApp(ui, server)

Make sure that the app.R has a folder called www where the gif is saved.

Mr.Rlover
  • 2,523
  • 3
  • 14
  • 32