【发布时间】:2015-04-15 20:45:49
【问题描述】:
我想根据单选按钮的输入值设置滑块的动态最小值和最大值。现在我可以使用 renderUI 选项来做到这一点,我在 server.ui 中设置了我的最小值和最大值,并且这些值是动态设置的。
但是当我将动画选项放在渲染UI 中时,它无法正常工作。在我的 ui.r 中,我有以下代码。
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")
在我的 server.r 中,我设置了如下值。
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")
【问题讨论】:
-
我这里似乎也有同样的问题。自从您发布问题后,您是否设法找到解决此问题的方法/解决方法?