Brilliant mistake - user interactivity / input not working

Whenever I try to run an application that has interactivity (for example, the input signal is close in the course notes), I get an output similar to the one below. I get a listen on http: // ... right after entering runApp (). I get an error as soon as the URL page opens. I tried uninstalling and reinstalling both shiny and rtools. The only difference that I saw as a result of my actions is that when you start the application, where before opening the browser in Chrome, this application opens the R window, which immediately closes.

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

server.R

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

I use Windows 7 and Google Chrome as my browser.

sessionInfo () returns the following:

 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_ 

The output of Sys.info () is as follows [with deleted user credentials]:

  sysname release version "Windows" "7 x64" "build 7601, Service Pack 1" machine "x86-64" 
+6
source share
1 answer

I had the same problem. This is due to a function in my server file:

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

I deleted it and everything returned to

0
source

Source: https://habr.com/ru/post/974965/


All Articles