Let's say I have the following server.R file in brilliant form:
shinyServer(function(input, output) { output$plot <- renderPlot({ data2 <- data[data$x == input$z, ]
What can I do to not start data2 <- data[data$x == input$z, ] in every render call? If I do the following, I get an "object of type" closure "not a subset":
shinyServer(function(input, output) { data2 <- reactive(data[data$x == input$z, ]) output$plot <- renderPlot({ plot(data2$x, data2$y) }) output$table <- renderTable({ data2 <- data[data$x == input$z, ] summary(data2$x) }) })
What have I done wrong?
r shiny subset
Waldir Leoncio Jul 16 '13 at 18:08 2013-07-16 18:08
source share