It's my first time create a web app. I had some problems about subsetting the data under shiny server. It's a large dataset. I want to subset the data by the conditions we enter in the UI. But I failed.
It shows "Error in eval: attempt to apply non-function". Could someone help me with it? Thank you so much. My ultimate goal is to build the app to subset data through a large dataset and apply the calculation on the subset. Finally, present the result through the shiny app.
I have coded the calculation process and UI. How can I combine those? Do we have to code everything under server? Can I just place some code under the global environment? Will the global environment have connection with the server? Thank you.
Attached is the picture of my code. How could I revise it to make it work?Thanks!!!!!
server <- function(input,output){
sex <- reactive({sex <- input$sex})
impairment <- reactive({impairment <- input$impairment})
sub1<- reactive({subset(a2e,Sex == input$sex() & AVS.Impairment ==
input$impairment() )})
output$distPlot <- renderPlot(plot{sub1()$Age})
}
shinyApp(ui=ui,server=server)
I wanted to subset the data based on sex and impairments. Just to check if it is working, I chose to plot random column in the dataset. But it didn't work. Please help me. :)