Reputation: 335
I am trying to put an image inside the infoBox
of a shinyApp.
I am getting this error:
Error in shinyUI(dashboardPage, dashboardHeader("ABC"), dashboardBody(fluidPage(h1("type"), : unused arguments (dashboardHeader("ABC"), dashboardBody(fluidPage(h1("type"), mainPanel(tabsetPanel(tabPanel(h1("summary"), infoBox("BCD", a, div(img(src = "ribbon.PNG", width = 100), style = "text-align: center;"))))))))
Code:
library(shiny)
library(shinydashboard)
a = 45
ui < - shinyUI(dashboardPage,
dashboardHeader("ABC"),
dashboardBody(fluidPage(h1("type"),
mainPanel(
tabsetPanel(
tabPanel(h1("summary"),
infoBox("BCD", a, div(img(src = "ribbon.PNG",
width = 100), style = "text-align: center;"))))))))
server <- shinyServer({})
shinyApp(ui, server)
Can anyone help me on this?
Upvotes: 1
Views: 1014
Reputation: 1671
Set an image img.png
in the www
folder and then the code below works :
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)
Upvotes: 3