diff --git a/shiny-app/server.R b/shiny-app/server.R index 56c5dc4..67a2319 100644 --- a/shiny-app/server.R +++ b/shiny-app/server.R @@ -4,8 +4,10 @@ library(shiny) shinyServer(function(input, output) { emergency2013 <- read.csv("./data/emergency2013.csv") - output$distPlot <- renderPlot({ + output$mytable1 <- renderDataTable({ + library(ggplot2) + emergency2013[, input$show_vars, drop = FALSE] - plot(emergency2013$erdatemm, emergency2013$vstctgry) + }) }) \ No newline at end of file diff --git a/shiny-app/ui.R b/shiny-app/ui.R index e964bc3..b9562a3 100644 --- a/shiny-app/ui.R +++ b/shiny-app/ui.R @@ -13,9 +13,11 @@ shinyUI(fluidPage( names(emergency2013), selected = names(emergency2013)) ), - # Show a plot of the generated distribution + # Show a summary table of the selected variables mainPanel( - plotOutput("distPlot") + tabsetPanel( + id = 'dataset', + tabPanel('emergency2013', dataTableOutput('mytable1'))) ) ) )) \ No newline at end of file