0

I try to display PNG picture in a dataFrame on my Rshiny app using picture stored locally. Following an other answer to the question here Stackoverflow topiv, I tried the code below with picture stored in the www files at the root of my app.r . Unfortunately, it does not display. I works when the source in a internet webpage, but not locally.

library(shiny)
library(DT)

ui <- shinyUI(
  DT::dataTableOutput('mytable')
)

dat <- data.frame(
  country = c('USA', 'China'),
  flag = c('<img src="www/picture_usa.png" height="52"></img>',
           '<img src="www/picture_china.png" height="52"></img>'
  )
)

server <- shinyServer(function(input, output){
  output$mytable <- DT::renderDataTable({
    DT::datatable(dat, escape = FALSE)
  })
})

shinyApp(ui, server)

Am i missing something?

Johann
  • 77
  • 6

0 Answers0