I have the following dataframe
df<-data.frame("A"<-c(1:5), 'B'<-c("a", 'b', 'c', 'd', 'e'))
names(df)<-c('A', "B")
I have created a select box in R shiny UI and have also written the code for the server as below.
ui<- fluidPage(
selectInput(inputId = "input", label = "No of days elapsed", choices =
c(0:1000), selected = T, multiple =F
),mainPanel(verbatimTextOutput("Output1")))
server<-function(input, output){text<-reactive({number<-input$input
number<-as.numeric(number)
Y<-function(X){if(X<5){
A<-df[!df$A==X,]} else {A<-df[df$A==(X-3),]}
return (A)}
out1<-Y(number)
})
renderPrint({text()$B})
}
shinyApp(ui, server)
The code generates the select box box. However, When i use the box and choose a number, there is no output. Also no error appears. I am not sure where my error is