I am working on a Shiny application and I was wondering if it was possible to skip one value between the min and max values passed in the selectInput function. I have this:
sliderInput(inputId="timeseries.year", label="Select Year or press play:", min=1970, max=2011, value=1994, step = 1,sep="", animate=animationOptions(interval=700,loop=F)
So the min is 1970 and the max is 2011 and I want to exclude the value 1993 (because it is missing). Please let me know if there is a way to do this!
It looks like
shiny
uses ion rangeslider for itsinputSlider
. Looking at the docs, it does look like it's possible to have custom values, either by adding adata-values
attribute before initialization, or you can update the slider after it's been initialized. Here is a very hacky way to achieve the second approach. It can probably be a lot cleaner, but basically what I'm doing is adding JavaScript that updates thevalues
parameter of the slider 5 milliseconds after the app initializes. I'm doing this hacky 5 millisecond thing simply because I don't know what's the right way to know when shiny is ready. There must be a cleaner way of determining when to make that call, but the idea of updating the slider still holds. Hope this helps