rstudio / shinydashboard

Shiny Dashboarding framework
https://rstudio.github.io/shinydashboard/
Other
887 stars 299 forks source link

Couldn't find function error after using renderValueBox() #288

Closed KafeelBasha closed 5 years ago

KafeelBasha commented 5 years ago

I was able to upload the file and look at the data in a separate tab, but have problem while analyzing the data, below are the updated codes I am trying to run.

library(shiny) library(shinydashboard) shinyUI( dashboardPage( dashboardHeader(title="Feedback Analysis"), dashboardSidebar( fileInput("file","Upload CSV files",multiple=TRUE,accept=("text/comma")), sidebarMenu(id="tabs", menuItem("Data",tabName="Data",icon=icon("table"),startExpanded = TRUE), menuItem("Summary statistics",selectInput("Question",h1("Response to be analysed"), choices=names(values$df_data),selected=values()$df_data[,1]), tabName="Feedback Analysis") ) ), dashboardBody( tabItems( tabItem(tabName="Data", h2("Data Set"),tableOutput("data.frame")), tabItem(tabName="Feedback Summary",h3("Feedback Analysis"), fluidRow( infoBoxOutput("rcount") )) ) ) ) )

library(shiny) library(shinydashboard) library(dplyr)

server<-shinyServer(function(input,output){ values <- reactiveValues(df_data = NULL)

observeEvent(input$file, { values$df_data <- read.csv(input$file$datapath) })

observeEvent(input$Go, { temp <- values$df_data[-input$Delete, ] values$df_data <- temp

}) output$data.frame <- renderTable(values$df_data) #I was able to print the data in dashboard output$rcount<-renderValueBox(nrow(filter(values()$df_data[,11]=="Good")),"Response Count") }) Error in values: could not find function "values" Please help.