log scale on slider input?

1,112 views
Skip to first unread message

Trevor Paulsen

unread,
Aug 8, 2013, 3:16:25 PM8/8/13
to shiny-...@googlegroups.com
Hi, I've got a slider input to select a statistical confidence interval.  The tricky part is that the difference between .99 and .999 is a very large swing in the confidence interval whereas the difference between .65 and .85 is pretty small.  Is there a way to adjust the slider bar so that it's on a log scale or something?  Ideally, for my project the leftmost value would be like .65, the middle value .95, and the far right value be .999 and still have continuous values in between.

Do I need to use a transformation function so that the value is really 0 to 1, but it translates to whatever input I need?  If so, how can I get the output to show .65 to .999 even though the value of the slider bar itself is 0 to 1?

Winston Chang

unread,
Aug 9, 2013, 4:20:05 PM8/9/13
to shiny-...@googlegroups.com
The jslider widget that the sliderInput uses is capable of displaying arbitrary labels on each tick, but Shiny's R and Javascript code that wraps up the jslider doesn't expose all of the functionality that would be needed.

See example here:

The labels are arbitrary, and are manually set so they appear logarithmic; the actual values are shown on top. Probably for your case, you'd want to hide the value on top or make it display a transformed value.

If you're curious about what jslider can do, see the last example here - it uses times for labels and has a transformation function to show the time for the labels below, and for the value above the slider.

-Winston



On Thu, Aug 8, 2013 at 2:16 PM, Trevor Paulsen <admos...@gmail.com> wrote:
Hi, I've got a slider input to select a statistical confidence interval.  The tricky part is that the difference between .99 and .999 is a very large swing in the confidence interval whereas the difference between .65 and .85 is pretty small.  Is there a way to adjust the slider bar so that it's on a log scale or something?  Ideally, for my project the leftmost value would be like .65, the middle value .95, and the far right value be .999 and still have continuous values in between.

Do I need to use a transformation function so that the value is really 0 to 1, but it translates to whatever input I need?  If so, how can I get the output to show .65 to .999 even though the value of the slider bar itself is 0 to 1?

--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages