I'm trying to have a dynamic message functionality on my dashboard which I'm creating using shiny R. This is my code:
server.R
library(shiny)
library(shinydashboard)
shinyServer(function(input,output){
output$`$histogram`<- renderPlot({
hist(faithful$eruptions,breaks = input$bins)
})
output$msgOut <- renderMenu({
msgs <- apply(read.csv("msg.csv"),1,function(row){
messageItem(from = row[["from"]],message = row[["message"]])}
)
dropdownMenu("messages", .list = msgs)
})
})
ui.R
library(shiny)
library(shinydashboard)
shinyUI(
dashboardPage(
dashboardHeader(title="Edureka",dropdownMenuOutput("msgOut")
# dropdownMenu(
# type = "message",
# messageItem(from = "Finance Update",message = "whats up niggas"),
# messageItem(from = "Sales Update",message = "Meeting at 6PM on Monday", time = "15:00",icon = icon("handshake-o"))
# )
),
dashboardSidebar(
sliderInput("bins","number of breaks",1,100,50),
sidebarMenu(
menuItem("Monthly Sales",tabName = "dashboard"),
menuSubItem("DevOps",tabName = "DevOps"),
menuSubItem("Blockchain",tabName = "Blockchain"),
menuSubItem("AWS",tabName = "AWS"),
menuItem("Finance Dashboard",tabName = "Finance"),
menuSubItem("Revenue Generated",tabName = "Revenue"),
menuSubItem("Company Expenditure",tabName = "Expenditure"))
),
dashboardBody(
tabItems(
tabItem(tabName = "dashboard",
fluidRow(
box(plotOutput("$histogram")))
),
tabItem(tabName = "DevOps",h1("DevOps courses sold")
),
tabItem(tabName = "Blockchain",h1("Blockchain courses sold")
),
tabItem(tabName = "AWS",h1("AWS Courses sold")),
tabItem(tabName = "Finance",h1("Financial Growth")),
tabItem(tabName = "Revenue", h1("Revenue Generated")),
tabItem(tabName = "Expenditure",h1("Company Expenditures"))
)
)
)
)
I get this error when i run the app