Friends could help me insert a figure into my shiny navbarPage. I would like to remove the written word "Simulation" in my navbarPage and insert the attached figure instead. Is this possible to do in shiny? any help is appreciated. The executable code is below.
library(shiny)
library(shinytables)
ui <- bootstrapPage(
navbarPage(theme = shinytheme("flatly"), collapsible = TRUE,
"Simulation",
sidebarLayout(
sidebarPanel(
sliderInput("bins",
"Number of bins:",
min = 1,
max = 50,
value = 30)
),
sidebarLayout(
sidebarPanel(
sliderInput("bins",
"Number of bins:",
min = 1,
max = 20,
value = 30),
),
mainPanel(
plotOutput("distPlot")
)
)
)))
server <- function(input, output) {
output$distPlot <- renderPlot({
# generate bins based on input$bins from ui.R
x <- faithful[, 2]
bins <- seq(min(x), max(x), length.out = input$bins + 1)
# draw the histogram with the specified number of bins
hist(x, breaks = bins, col = 'darkgray', border = 'white')
})
}
# Run the application
shinyApp(ui = ui, server = server)
Thank you very much!
Insertion this code
ui <- shiny::navbarPage(
title = div(img(src='simulation.jpg',style="margin-top: -14px; padding-right:10px;padding-bottom:10px", height = 60)),
windowTitle="Simulation",
Would this work?