A couple of problems. The first and biggest problem is that you don't seem to understand how reactivity works. The error says that "the operation is not resolved without an active reactive context", and that the problem is that you are accessing x() inside the main object of the server function, but not within the reactive context. Any render* function is a reactive context, for example. So, to solve this problem, you just need to move the if statement inside renderPrint .
Another small problem is that your output identifiers do not match ( verbatimTextOutput("odic") vs output$oid2 ).
If you do not understand reactivity, I strongly recommend that you take half an hour to understand it better. This tutorial has a section on reactivity that might be useful, or you can re-read the official brilliant RStudio tutorial.
Here is the code for your fixed application (I removed a bunch of useless interface elements)
library(shiny) ui <- fluidPage( numericInput('id1', 'Numeric input, labeled id1', 0, min = 0, max = 100, step=5), verbatimTextOutput("oid1"), verbatimTextOutput("oid2") ) server <- function(input, output, session) { output$oid1 <- renderPrint({input$id1}) x<-reactive({5*input$id1}) output$oid2<-renderPrint({ if (x()>50) { "You entered a number greater than 10" } else { "You entered a number less than or equal to 10" } }) } shinyApp(ui = ui, server = server)
source share