【发布时间】:2016-06-30 09:22:51
【问题描述】:
我想在shiny 中实现一个滑块。
在我的server.R 这边我有这个
output$daterange <- renderUI({
if( (input$var1 == 6) ) {
sliderInput(inputId = "daterange",
label = "Datum",
min = as.Date("2019-01-01"),
max = as.Date("2001-01-01"),
value = as.Date("2001-01-01"),
timeFormat = "%b %Y"
)
} else {
sliderInput(inputId = "daterange",
label = "Datum",
min = as.Date("1990-01-01"),
max = as.Date("2000-01-01"),
value = as.Date("1990-01-01"),
timeFormat = "%b %Y"
)
}
})
在我的ui.R 这边我有这个:
uiOutput("daterange")
我在 App 中得到的不是滑块,而是一个可以输入文本的字段...
这是为什么呢?
【问题讨论】:
-
请提供ui.R和server.R代码,以便我们重现问题。见
shiny::shinyApp(ui = ..., server = ...)