Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 实现复选框以选择列表中的所有日期列_R_Shiny - Fatal编程技术网

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()

库(闪亮)
用户界面