title: Got 'argument 1 is empty error' with selectInput in shinydashboard
body: <p>I have a shiny app like below using <code>diamonds</code> dataset as an example. I'm using two selectInput as data filter. The first one select a variable. The second one shows the values, depending on the variable selected in the first selectInput. After selection, click the actionButton to trigger the filter. Without any variable and value selected, I want it output the whole dataset. </p>
  
  <p>What I found is after I clear the two selectInput and then click the actionButton,  I got error: <code>argument 1 is empty</code>.  I do not understand why that happens. Spent hours but unable to find the solution. Do anyone know how I can fix it?  Thanks a lot!</p>
  
  <pre><code>library(shiny)
  library(shinydashboard)
  library(dplyr)
  library(rlang)
  
  data(diamonds)
  
  df = diamonds[1:1000,]
  
  subset_data = function(data,
                         var=NULL,
                         value=NULL){
  
      if (!is.null(var)) {
          if(!is.null(value)) {
              data = data %&gt;% filter(!!sym(var) == value)
          }
      }
  
      return(data)
  }
  
  ui &lt;- dashboardPage(
      dashboardHeader(title = "example"),
      dashboardSidebar(),
      dashboardBody(
          fluidRow(
  
  
              selectizeInput(inputId = 'var', 
                             label='Select variable',
                             choices = c('cut', 'color'), 
                             multiple=FALSE,
                             options = list(
                                 maxItems = 1,
                                 placeholder = '',
                                 onInitialize = I("function() { this.setValue(''); }"))),
  
              uiOutput("valueUI"),
              actionButton('go', 'apply filter'),
  
              tableOutput('table')
          )
      )
  )
  
  server &lt;- function(input, output, session) {
  
      output$valueUI = renderUI({
  
          if (input$var == '') {
              vals = '' 
          }
          if (input$var == 'cut') {
              vals = c('Premium', 'Good', 'Very Good', 'Fair')  
          }
          if (input$var == 'color'){
              vals = c('E', 'J', 'I', 'H')
          }
  
          selectizeInput(inputId = 'value', 
                         label='Select values',
                         choices = c('',vals), 
                         multiple=FALSE,
                         options = list(
                             maxItems = 1,
                             placeholder = '',
                             onInitialize = I("function() { this.setValue(''); }")))
  
      })
  
      dat = reactive({
          input$go
  
          isolate( subset_data(data=df, var=input$var, value=input$value) )
      })
  
      output$table &lt;- renderTable({
          dat()
      })
  }
  
  shinyApp(ui, server)
  </code></pre>