title: Creating a categorical sliderInput within a rendered UI in R shiny
body: <p>I'm trying to create a categorical (as opposed to numeric) slider in shiny using <code>sliderInput</code>. Thanks to Dean Atali's answer here (<a href="https://stackoverflow.com/questions/30502870/shiny-slider-on-logarithmic-scale">Shiny slider on logarithmic scale</a>), I'm able to create the slider. </p>
  
  <p>However, I need to create the slider in <code>server</code> and pass it to the UI via <code>renderUI</code> and <code>uiOutput</code>. But, when I move the <code>sliderInput</code> into a <code>renderUI</code> call on the server-side, it no longer works. Here are two examples: the first one showing how the categorical slider works (when not using <code>renderUI</code>/<code>uiOutput</code>), and the second one showing how the categorical slider does not work (when using <code>renderUI</code>/<code>uiOutput</code>).</p>
  
  <p><strong>WORKING EXAMPLE (slider created in the UI)</strong></p>
  
  <pre><code>library(shiny)
  JScode &lt;-
    "$(function() {
  setTimeout(function(){
  var names = ['Unrated', 'Emerging', '&amp;nbsp;',  'Formative', '&amp;nbsp;', '&amp;nbsp;', 'Developed', '&amp;nbsp;'];
  var vals = [];
  for (i = 0; i &lt; names.length; i++) {
  var val = names[i];
  vals.push(val);
  }
  $('#pvalue').data('ionRangeSlider').update({'values':vals})
  }, 7)})"
  
  runApp(shinyApp(
    ui = fluidPage(
      tags$head(tags$script(HTML(JScode))),
      textOutput('texty'),
      sliderInput("pvalue",
                  "PValue:",
                  min = 0,
                  max = 7,
                  value = 0
      )
    ),
    server = function(input, output, session) {
  
      output$texty &lt;- renderText({
        input$pvalue
      })
    }
  ))
  </code></pre>
  
  <p><strong>Non-working example (slider created in <code>server</code>)</strong></p>
  
  <pre><code>library(shiny)
  JScode &lt;-
    "$(function() {
  setTimeout(function(){
  var names = ['Unrated', 'Emerging', '&amp;nbsp;',  'Formative', '&amp;nbsp;', '&amp;nbsp;', 'Developed', '&amp;nbsp;'];
  var vals = [];
  for (i = 0; i &lt; names.length; i++) {
    var val = names[i];
    vals.push(val);
  }
  $('#pvalue').data('ionRangeSlider').update({'values':vals})
  }, 7)})"
  
  runApp(shinyApp(
    ui = fluidPage(
      tags$head(tags$script(HTML(JScode))),
      textOutput('texty'),
      uiOutput('uu')
    ),
    server = function(input, output, session) {
  
      output$texty &lt;- renderText({
        input$pvalue
      })
      output$uu &lt;- renderUI({
        sliderInput("pvalue",
                    "PValue:",
                    min = 0,
                    max = 7,
                    value = 0
        )
      })
    }
  ))
  </code></pre>
  
  <p>How do I make the slider show the categories (rather than numbers) when the slider is generated in <code>server</code>?</p>