I wanted to set dynamic minimum and maximum values for the slider based on the input value of a radio button. Now I was able to do this using renderUI option, I set my min and max values in the server.ui and values are set dynamically.
But when I put animation options inside the renderUI that does not work properly. In my ui.r I have following codes.
radioButtons("interval", "Time Interval:",
c("Day of the week"="%u","Day of the month" = "%d", "Week of the year" = "%W", "Month of the year" = "%m","Quarter of the year"="quarter","year"="%y"))
,uiOutput("Slider")
And in my server.r I have set values as follows.
order$date_of_month<-as.numeric(format(as.Date(order$Date.Ordered), interval))
output$Slider<-renderUI({
sliderInput("date_range", "Date Range", min = 2,
max = max(order$date_of_month), value = max(order$date_of_month)
,step = 1
,animate = animationOptions(loop = TRUE, interval = 5000))
})
radioButtons("interval", "Time Interval:",
c("Day of the week"="%u","Day of the month" = "%d",
"Week of the year" = "%W", "Month of the year" = "%m","Quarter of the year"="quarter","year"="%y"))
,uiOutput("Slider")