R 实现复选框以选择列表中的所有日期列
我有一个类似以下内容的数据集:R 实现复选框以选择列表中的所有日期列,r,shiny,R,Shiny,我有一个类似以下内容的数据集: lat lon 2020-01-22 2020-01-23 2020-01-24 2020-01-25 2020-01-26 2020-01-27 32.53953 -86.64408 0 0 0 0 0 0 30.72775 -87.72207 0 0 0
lat lon 2020-01-22 2020-01-23 2020-01-24 2020-01-25 2020-01-26 2020-01-27
32.53953 -86.64408 0 0 0 0 0 0
30.72775 -87.72207 0 0 0 0 0 0
31.86826 -85.38713 0 0 0 0 0 0
32.99642 -87.12511 0 0 0 0 0 0
33.98211 -86.56791 0 0 0 0 0 0
32.10031 -85.71266 0 0 0 0 0 0
我正在开发一个闪亮的应用程序,允许用户使用dateRangeInput指定日期范围。但是,我还想让用户选择使用checkboxInput的所有可用日期,但我不确定如何实现这一点。以下是我到目前为止的情况:
ui <- fluidPage(
sidebarLayout(
sidebarPanel(
dateRangeInput("date", "Date Range:",
start = as.character(Sys.Date() - 30),
end = as.character(Sys.Date())),
checkboxInput("checkBox", "Select all dates", FALSE),
textOutput("warning")
),
mainPanel(
## Plot & Table will go here
)
)
)
server <- function(input, output) {
output$warning <- renderText({
validate(
need(input$date[2] > input$date[1], "Error in date specification")
)
})
ui要为所有可能的日期选择日期范围,您需要指定min
和max
。然后,使用updatedTerangeInput()
。
库(闪亮)
用户界面