From c62397ff21180fe0580aade1f9fe15ce286232ac Mon Sep 17 00:00:00 2001 From: Aron Lindberg Date: Sat, 7 Nov 2015 12:37:27 -0500 Subject: [PATCH 1/7] replaced plot with summary table --- shiny-app/server.R | 6 ++++-- shiny-app/ui.R | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) 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 From 558c05bb5152b869d0c41931255e41a3066dc17d Mon Sep 17 00:00:00 2001 From: Aron Lindberg Date: Sat, 7 Nov 2015 13:46:18 -0500 Subject: [PATCH 2/7] add plot tab --- shiny-app/ui.R | 1 + 1 file changed, 1 insertion(+) diff --git a/shiny-app/ui.R b/shiny-app/ui.R index b9562a3..36df7ff 100644 --- a/shiny-app/ui.R +++ b/shiny-app/ui.R @@ -18,6 +18,7 @@ shinyUI(fluidPage( tabsetPanel( id = 'dataset', tabPanel('emergency2013', dataTableOutput('mytable1'))) + tabPanel('emergency2013', plotOutput('myplot'))) ) ) )) \ No newline at end of file From e756c786516e06f90176269df1f418275d28d08c Mon Sep 17 00:00:00 2001 From: Aron Lindberg Date: Sat, 7 Nov 2015 13:46:39 -0500 Subject: [PATCH 3/7] select none by default --- shiny-app/ui.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shiny-app/ui.R b/shiny-app/ui.R index 36df7ff..3a77a3f 100644 --- a/shiny-app/ui.R +++ b/shiny-app/ui.R @@ -10,7 +10,7 @@ shinyUI(fluidPage( sidebarLayout( sidebarPanel( checkboxGroupInput('show_vars', 'Columns in dataset to show:', - names(emergency2013), selected = names(emergency2013)) + names(emergency2013), selected = NULL) ), # Show a summary table of the selected variables From ec2950779fd728a35d07c6817f6740cdc1dd4274 Mon Sep 17 00:00:00 2001 From: geoffreyli Date: Sat, 7 Nov 2015 13:46:54 -0500 Subject: [PATCH 4/7] Add tab for scatter plot --- shiny-app/server.R | 9 +++++++-- shiny-app/ui.R | 8 ++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/shiny-app/server.R b/shiny-app/server.R index 67a2319..effd3f9 100644 --- a/shiny-app/server.R +++ b/shiny-app/server.R @@ -1,13 +1,18 @@ library(shiny) +library(ggplot2) # Define server logic required to draw a histogram shinyServer(function(input, output) { emergency2013 <- read.csv("./data/emergency2013.csv") + output$distPlot <-renderPlot({ + plot(emergency2013$duid, emergency2013$vstctgry) + }) + output$mytable1 <- renderDataTable({ - library(ggplot2) + emergency2013[, input$show_vars, drop = FALSE] - + }) }) \ No newline at end of file diff --git a/shiny-app/ui.R b/shiny-app/ui.R index b9562a3..998d4fa 100644 --- a/shiny-app/ui.R +++ b/shiny-app/ui.R @@ -10,14 +10,18 @@ shinyUI(fluidPage( sidebarLayout( sidebarPanel( checkboxGroupInput('show_vars', 'Columns in dataset to show:', - names(emergency2013), selected = names(emergency2013)) + names(emergency2013), selected = null) ), # Show a summary table of the selected variables + + mainPanel( tabsetPanel( id = 'dataset', - tabPanel('emergency2013', dataTableOutput('mytable1'))) + tabPanel('emergency2013', dataTableOutput('mytable1')), + tabPanel('scatterplot', plotOutput('distPlot')) + ) ) ) )) \ No newline at end of file From 03d304c9ef3aae75e6cb3e6a5132550f376c2fa8 Mon Sep 17 00:00:00 2001 From: Aron Lindberg Date: Sat, 7 Nov 2015 13:48:22 -0500 Subject: [PATCH 5/7] add corrplot --- shiny-app/server.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shiny-app/server.R b/shiny-app/server.R index 67a2319..a7c469d 100644 --- a/shiny-app/server.R +++ b/shiny-app/server.R @@ -9,5 +9,7 @@ shinyServer(function(input, output) { emergency2013[, input$show_vars, drop = FALSE] + library(corrplot) + pairs(emergency2013[, input$show_vars, drop = FALSE]) }) }) \ No newline at end of file From 675ca16f02cffa085e6f2ffeaa0214cc27264b19 Mon Sep 17 00:00:00 2001 From: Aron Lindberg Date: Sat, 7 Nov 2015 13:50:31 -0500 Subject: [PATCH 6/7] add plot --- shiny-app/server.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/shiny-app/server.R b/shiny-app/server.R index a7c469d..70cf266 100644 --- a/shiny-app/server.R +++ b/shiny-app/server.R @@ -5,10 +5,10 @@ shinyServer(function(input, output) { emergency2013 <- read.csv("./data/emergency2013.csv") output$mytable1 <- renderDataTable({ + emergency2013[, input$show_vars, drop = FALSE] + }) + output$myplot <- renderPlot({ library(ggplot2) - emergency2013[, input$show_vars, drop = FALSE] - - library(corrplot) pairs(emergency2013[, input$show_vars, drop = FALSE]) }) From d54abb5f26d70a4a2dbf604b7199cf23abf476c5 Mon Sep 17 00:00:00 2001 From: Aron Lindberg Date: Sat, 7 Nov 2015 15:10:20 -0500 Subject: [PATCH 7/7] Merge remote-tracking branch 'origin/master' Conflicts: shiny-app/server.R --- shiny-app/server.R | 10 ++++++++++ shiny-app/ui.R | 14 ++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/shiny-app/server.R b/shiny-app/server.R index 70cf266..b46e34e 100644 --- a/shiny-app/server.R +++ b/shiny-app/server.R @@ -1,12 +1,22 @@ library(shiny) +library(ggplot2) # Define server logic required to draw a histogram shinyServer(function(input, output) { emergency2013 <- read.csv("./data/emergency2013.csv") + output$distPlot <- renderPlot({ + plot(emergency2013$duid, emergency2013$vstctgry) + }) + output$mytable1 <- renderDataTable({ emergency2013[, input$show_vars, drop = FALSE] }) + + output$mytable2 <- renderDataTable({ + summary(emergency2013[, input$show_vars, drop = FALSE]) + + }) output$myplot <- renderPlot({ library(ggplot2) library(corrplot) diff --git a/shiny-app/ui.R b/shiny-app/ui.R index 3a77a3f..de2616a 100644 --- a/shiny-app/ui.R +++ b/shiny-app/ui.R @@ -9,16 +9,14 @@ shinyUI(fluidPage( # Sidebar with a slider input for the number of bins sidebarLayout( sidebarPanel( - checkboxGroupInput('show_vars', 'Columns in dataset to show:', - names(emergency2013), selected = NULL) - ), - - # Show a summary table of the selected variables + checkboxGroupInput('show_vars', 'Columns in dataset to show:', names(emergency2013), selected = NULL)), + # Show a summary table of the selected variables mainPanel( tabsetPanel( id = 'dataset', - tabPanel('emergency2013', dataTableOutput('mytable1'))) - tabPanel('emergency2013', plotOutput('myplot'))) + tabPanel('emergency2013', dataTableOutput('mytable1')), + tabPanel('emergency2013', dataTableOutput('mytable2')), + tabPanel('emergency2013', plotOutput('myplot')))) ) ) -)) \ No newline at end of file +) \ No newline at end of file