Thus, it would be useful to see another logic of your code. Perhaps I would say that in general it is very important to understand how reactive expressions work in the context of program logic. I would try to read as much code as possible on the shiny homepage. Here is a quick script, I wrote that I think it turns out that you are asking. amuses.
Global.r
library(plyr) library(dplyr) exp <- data.frame(Ind=rep(c("a","b"),each=50),val1=rgamma(100,10,5),val2=rnorm(100,2,3.5))
Server.r
library(shiny) library(ggvis) shinyServer(function(input, output, session) { output$selectO <- renderUI({ selectInput(inputId="selectI", label = h4("Level to Plot"), choices = list("a","b","c"),selected="a") }) observe({ if(!is.null(input$selectI)){ expfilter <- reactive({ vals <- exp %>% filter(Ind == input$selectI) return(vals) }) if(nrow(expfilter())==0){ fail <- reactive({ return("filter failed") }) output$trouble <- renderText({fail()})
ui.r
library(shiny) shinyUI(fluidPage( column(3, wellPanel( uiOutput("selectO") ) ), column(9, wellPanel( ggvisOutput("plot1")), wellPanel(h6("How Did the Filter Do"), textOutput("trouble") ) ) ) )
source share