How to load an image in Shiny
I would like to display an image in my shiny app but I can't find the path I have to give.
My app structure is the following :
App>
server.R
ui.R
wwww>
images>
image.png
And I have the following code :
ui <- fluidPage(
tags$div(img(src = "www/images/image.png"))
)
server <- function(input, output) {}
runApp(list(ui = ui, server = server))
It doesn't work.
I tried a lot of syntax for the path, even something like
options("shiny.port" = 8080) img(src = paste0("http://127.0.0.1:", getOption("shiny.port"), "/www/images/image.png"))
But i'm realy struggling to disply the image, in the html inspector I always have "failed to load the given url". If you have any ideas... thanks !
NB : I'm able to load css with the same syntax (ie tags$style("www/css/style.css"))
它应该没有“www /”前缀: img(src = "images/image.png")
上一篇: R / shiny中的条件面板
下一篇: 如何在Shiny中加载图像