Posted on

r如何在shiny app中加载网络图片:

library("shiny")
library(shinydashboard)
ui <- dashboardPage(
  dashboardHeader(),
  dashboardSidebar(),
  dashboardBody(
    fluidRow(

      box(title ="Demo1",status = "warning",solidHeader = TRUE,
        tags$img(src = "https://www.jingege.wang/wp-content/uploads/2020/05/mmexport1497442466586-scaled-1.jpg",width=500)
      ),

      box(title ="Demo2",status = "primary",solidHeader = TRUE,
          uiOutput(outputId = "image")
      )
    )
  )
)
server <- function(input, output) {
  output$image <- renderUI({
    tags$img(src = "https://www.jingege.wang/wp-content/uploads/2020/05/mmexport1497442466586-scaled-1.jpg",width=500)
  })
}
shinyApp(ui = ui, server = server)

发表评论

邮箱地址不会被公开。 必填项已用*标注