Render UI R shiny dashboard issue -
i'm having issue renderui code. wanted shiny dashboard interactive user he/she can select particular dataset. given datasets have same set of variables , order, don't know why code won't work.
i'm having issue server code key work "bar". i've set "bar" define dataset user has chosen keep getting error:"error object of type 'closure' not subsettable".
the way code work far if edit "bar" fix dataset, defeat purpose of dashboard being "interactive"
here codes ui , server:
ui: #selecting dataset selectinput("dataset",label="select dataset of choice", choices= c("january_2016","february_2016"),selectize = true)
server:
shinyserver(function(input, output) ({ bar<- reactive({ switch(input$dataset, "january_2016" = names(january_2016), "february_2016" = names(february_2016)) }) output$vx <- renderui({ selectinput("variable","select variable", choices=bar()) }) #trying calculate column 2 of selected data set should satisfy condition output$dpmo <- renderui({ valuebox(format(sum(bar[which(bar[,2]== "apac - sena"),14])/(length(which(bar[,2]== "apac - anz"))*15)*1000000,digits=2,nsmall=0) , "dpmo of apac - anz", width = 3) })
Comments
Post a Comment