2

我正在使用 DT 包在 Shiny 中制作应用程序。多亏了其他建议,它运行良好,但是当我包含过滤器参数(默认为“无”)时,我收到下一条消息:

run(timeoutMs) 中的警告:min 没有非缺失参数;在 run(timeoutMs) 中返回 Inf 警告:max 没有非缺失参数;返回-Inf

我什至在上传文件之前就收到了这条消息,所以我认为问题可能出在 read.table 参数中,但我找不到解决方案。这是代码:

用户界面

library(shiny)
library(shinythemes)
library(DT)

shinyUI(fluidPage(theme = shinytheme("Journal"),

 fileInput("FileInput", "Choose file 1"),


 DT::dataTableOutput("table"))

服务器.r

library(shiny)
library(DT)

shinyServer(function(input, output, session) {

  datasetInput <- reactive({
    infile <- input$FileInput
    if(is.null(infile))
      return(NULL)
    read.table(infile$datapath, header = TRUE, sep="")

  })

  output$table = DT::renderDataTable(
    datasetInput(),
    filter='top',
    extensions = c('TableTools','ColVis'), 
    options = list(dom = 'TC<"clear">ftir',
                   tableTools = list(
                     "sSwfPath" =     "//cdnjs.cloudflare.com/ajax/libs/datatables-    tabletools/2.1.5/swf/copy_csv_xls.swf",
                     "aButtons" = list(
                       "copy",
                       "print",
                       list("sExtends" = "collection",
                            "sButtonText" = "Save",
                            "aButtons" = c("csv","xls")))),
                   ColVis = list(activate= "click", align = "right"))

  )})

此外,当我上传文件时(尽管包含过滤选项的警告),范围滑块不允许您选择间隔,只能选择行的不同值(抱歉,我还不能上传文件:)

4

1 回答 1

2

此问题已在DT当前开发版本(>= 0.1.16) 中修复必须有一列在您的数据中缺少所有值 ( ),在这种情况下,DT将禁用过滤器,因为过滤完整的 s 列没有任何意义。NANA

于 2015-07-09T22:34:49.737 回答