Thanks for your reply! I am using the following sample code. I added your suggestion to it but somehow the plot is still not getting displayed in the pop-up. Can you please take a look and suggest where I am going wrong? I am quite new to Shiny and I am sorry if my question seems very basic!
d <- ggplot(mtcars, aes(factor(cyl))) + geom_bar(fill="white", colour="darkgreen") + geom_bar(width=.5)
ui <- fluidPage(
titlePanel("US Map"),
sidebarPanel( p("Maps")),
mainPanel(
h1("Map"),
leafletOutput("mymap")#,
# plotOutput("myplot")
)
)
server <- function(input, output, session){
output$mymap <- renderLeaflet({
c <- paste(sep = "<br/>", "<b>HELLO</b>", "<i>world</i>",
as.character(div(renderPlot({d}))),
tags$ul(
tags$li("First list item"),
tags$li("Second list item"),
tags$li("Third list item")
),
tags$div(class = "graph",
tags$div(style="height: 22px;", class="bar"),
tags$div(style="height: 6px;", class="bar")),
)
leaflet() %>%
addTiles() %>%
addMarkers(lng=-86.7521667, lat=32.530605, popup= c)
})
}
shinyApp(ui, server)