【发布时间】:2020-10-02 04:26:31
【问题描述】:
我有一个如下所示的数据集:
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 指定日期范围。但是,我还想为用户提供使用复选框输入选择所有可用日期的选项,但我不确定如何实现这一点。这是我目前所拥有的:
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")
)
})
【问题讨论】: