Hi!
I am misunderstanding something about observe().
In the example below, I am expecting the contents of observe() to be executed only when (and immediately when) input$bar changes, i.e., when the actionButton is pushed.
Instead, the contents are executed immediately. In the warning message (seen in the log file), I see that input$bar=0, its initial value.
Shouldn't observe() wait to get executed until the button is pushed??
shinyUI(
pageWithSidebar(
headerPanel('Foo'),
sidebarPanel(
actionButton('bar',"Bar")
),
mainPanel( )
)
)
shinyServer(function(input, output,session) {
observe({
input$bar
warning(paste('input$bar value = ',input$bar))
warning("shouldn't get here without pushing 'bar' button")
})
})