0

I am building an app to analyze wind data using the packages “shiny” and “openair”.

I am trying to read the input data given by the user and use it as variables, but I keep getting:

Error in updateSelectInput(session, "pollutant", choices = names(df)) : 
  object 'session' not found
ERROR: [on_request_read] connection reset by peer

In the ui.r I have:

selectInput("pollutant", "Please choose pollutant", names(userdata))

and in the server.r:

observe({
    df <- userdata()
    str(names(df))
    if (!is.null(df)) {
      updateSelectInput(session, "pollutant", choices = names(df))   
    }
  })
Brunox13
  • 775
  • 1
  • 7
  • 21
eliavs
  • 2,306
  • 4
  • 23
  • 33

1 Answers1

4

It sounds like you're not including the session variable in the server definition? i.e. use (input, output, session) rather than just (input, output).

Jeff Allen
  • 17,277
  • 8
  • 49
  • 70