How to print file to Shiny using renderText

后端 未结 1 1995
执念已碎
执念已碎 2020-12-21 21:51

I\'m missing something here because the image doesn\'t display.

Thanks.

shinyServer(function(input, output) {
  src = \"einstein.jpg\"
  print(file         


        
1条回答
  •  佛祖请我去吃肉
    2020-12-21 22:42

    If you put your picture einstein.jpg in a img/ subfolder of your app, you can use addResourcePath to allow access to it:

    library(shiny)
    shinyApp(ui=fluidPage(htmlOutput("text3")),
             server=(function(input, output) {
               addResourcePath("foo", "img")  
               out = ''
               output$text3<-renderText(out)
             }))
    

    0 讨论(0)
提交回复
热议问题