Skip to content

Commit

Permalink
Make data reactive
Browse files Browse the repository at this point in the history
  • Loading branch information
mawds committed Aug 9, 2018
1 parent 6c8aa4b commit 4ee4c74
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions worked_example/app.R
Expand Up @@ -48,10 +48,14 @@ ui <- fluidPage(
# Define server logic required to draw a histogram
server <- function(input, output) {

output$gapminderPlot <- renderPlot({
gapminder %>%
plotData <- reactive({
gapminder %>%
filter(year == input$year) %>%
filter(continent %in% input$continent) %>%
filter(continent %in% input$continent)
})

output$gapminderPlot <- renderPlot({
plotData() %>%
produceGapminderPlot()
})
}
Expand Down

0 comments on commit 4ee4c74

Please sign in to comment.