title: How to use updateSliderInput to change from point to range slider
body: <p>Within the following example (ignoring the var select logic for now), is it possible to use <code>updateSliderInput</code> to change the year slider type from one which takes a single value if <code>input$slider_type == 'one'</code> (the default), but a range of values if <code>input$slider_type == 'two'</code>?</p>
  <p>If not, is the <code>uiOutput</code>/<code>renderUI</code> approach needed instead, or is there a third way?</p>
  <pre><code>library(tidyverse)
  library(shiny)
  
  
  dta &lt;- tibble(
    var =
      c(
        rep(&quot;A&quot;, 10),
        rep(&quot;B&quot;, 3),
        rep(&quot;C&quot;, 5)
      ),
    year = c(
      1984:1993,
      1987:1989,
      1990:1994
    )
  ) %&gt;%
    mutate(
      val = runif(n())
    )
  
  ui &lt;- fluidPage(
  
      titlePanel(&quot;Dynamic year slider&quot;),
  
      sidebarLayout(
          sidebarPanel(
              selectInput(
                &quot;var_select&quot;, &quot;Select variable&quot;,
                choices = unique(dta$var)[1],
                selected = unique(dta$var)[1]
              ),
              selectInput(&quot;slider_type&quot;, &quot;Select slider type&quot;,
                          choices = c(&quot;One value&quot; = &quot;one&quot;, &quot;Two values&quot; = &quot;more&quot;),
                          selected = &quot;one&quot;
  
                          ),
              sliderInput(&quot;year_select&quot;,
                          &quot;Select year:&quot;,
  
                          min = min(subset(dta, var == unique(dta$var)[1])$year),
                          max = max(subset(dta, var == unique(dta$var)[1])$year),
                          value = min(subset(dta, var == unique(dta$var)[1])$year),
                          step = 1,
                          sep = ''
  
              )
          ),
  
          mainPanel(
             tableOutput(&quot;table_output&quot;)
          )
      )
  )
  
  # Define server logic required to draw a histogram
  server &lt;- function(input, output) {
    current_var &lt;- reactive(input$var_select)
    current_slider_type &lt;- reactive(input$slider_type)
    current_year_value  &lt;- reactive(input$year_select)
  
    observeEvent(input$var_select, {
      message(&quot;The selected var is &quot;, current_var())
      freezeReactiveValue(input, &quot;year_select&quot;)
      updateSliderInput(inputId = &quot;year_select&quot;,
                        min = min(subset(dta, var == current_var())$year),
                        max = max(subset(dta, var == current_var())$year)
  
      )
    })
  
    observeEvent(input$slider_type, {
      this_slider_type &lt;- current_slider_type()
      message(&quot;The current slider type is &quot;, this_slider_type)
      if (this_slider_type == &quot;more&quot;){
        message(&quot;current_slider_type is more&quot;)
  
        updateSliderInput(inputId = &quot;year_select&quot;,
                          label = &quot;Select years&quot;, # this DOES update
                          value = c(1985, 1987) 
  # Only the first value is passed through in the update
  #the inclusion of a second value does not change the slider type from one which accepts only a single value, to one which accepts a range
        )
      } else if (this_slider_type == &quot;one&quot;){
        message(&quot;current_slider_type is one&quot;)
        updateSliderInput(inputId = &quot;year_select&quot;,
                            label = &quot;Select year&quot;,
                          value = 1986 # this DOES update 
        )
  
      }
  
    })
  
  
      output$table_output &lt;- renderTable({
        req(input$year_select)
        dta %&gt;%
          filter(var == input$var_select) %&gt;%
          filter(year %in% input$year_select)
      })
  }
  
  # Run the application
  shinyApp(ui = ui, server = server)
  
  </code></pre>