我找不到错误的图片,为什么图片没有显示在infoBox ShinyApp内。
library(shiny)
library(shinydashboard)
a <- 45
ui <- shinyUI(
dashboardPage(
dashboardHeader(title = "ABC"),
dashboardSidebar(),
dashboardBody(
fluidPage(
infoBox("BCD", a, div(img(src = "img.png", width = 100), style = "text-
align: center;"))
)
)
)
)
server <- function(input, output) {}
shinyApp(ui = ui, server = server)
答案 0 :(得分:0)
以下内容对我有用:
app.R
app.R
文件夹中,创建一个名为www
的文件夹,并将img.png
保存在其中答案 1 :(得分:0)
您可能想看看addResourcePath函数以获得更灵活的解决方案:
http://shiny.rstudio.com/reference/shiny/0.14/addResourcePath.html