【问题标题】:Shiny Error - User interactivity / input not working闪亮的错误 - 用户交互/输入不起作用
【发布时间】:2014-11-01 09:46:39
【问题描述】:

每当我尝试运行具有交互性的应用程序(例如课程笔记中闪亮的输入)时,我都会得到类似于以下内容的输出。我在输入 runApp() 后立即在 http://... 上收听。打开 URL 页面后,我立即收到错误消息。我试图卸载并重新安装闪亮和 rtools。由于我的操作,我看到的唯一区别是,当我运行应用程序时,之前它会在应用程序的 chrome 中打开一个浏览器窗口,现在它会打开一个 R 窗口,该窗口会立即关闭。

> runApp()

Listening on http://127.0.0.1:5066
ERROR: [on_request_read] connection reset by peer

ui.R

library(shiny)
shinyUI(pageWithSidebar(
        headerPanel("Illustrating inputs"),
        sidebarPanel(
                numericInput('id1', 'Numeric input, labeled id1', 0, min = 0, max = 10, step = 1),
                checkboxGroupInput("id2", "Checkbox",
                                   c("Value 1" = "1",
                                     "Value 2" = "2",
                                     "Value 3" = "3")),
                dateInput("date", "Date:")  
        ),
        mainPanel(
                h3('Illustrating outputs'),
                h4('You entered'),
                verbatimTextOutput("oid1"),
                h4('You entered'),
                verbatimTextOutput("oid2"),
                h4('You entered'),
                verbatimTextOutput("odate")
        )
))

服务器.R

library(shiny)
shinyServer(
        function(input, output) {
                output$oid1 <- renderPrint({input$id1})
                output$oid2 <- renderPrint({input$id2})
                output$odate <- renderPrint({input$date})
        }
)

我使用的是 Windows 7 和 google chrome 作为我的浏览器。

sessionInfo() 返回以下内容:

R version 3.1.1 (2014-07-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] shiny_0.10.1

loaded via a namespace (and not attached):
[1] bitops_1.0-6    caTools_1.17    digest_0.6.4    htmltools_0.2.4 httpuv_1.3.0   
[6] Rcpp_0.11.2     RJSONIO_1.3-0   tools_3.1.1     xtable_

Sys.info() 输出如下[删除用户凭据]:

                 sysname                      release                      version 
               "Windows"                      "7 x64" "build 7601, Service Pack 1" 
                machine 
                "x86-64"

【问题讨论】:

    标签: r shiny


    【解决方案1】:

    我也有同样的问题。它与我的服务器文件中的一个函数有关:

      observe(input$file1, {
           updateTabItems(session, "tabs", "upload")
       }
       )
    

    我删除了它,一切都恢复正常

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-06
      • 2019-07-01
      • 2016-03-26
      • 1970-01-01
      • 2017-02-10
      相关资源
      最近更新 更多