mirror of
https://github.com/bspeice/betterwithdata_cleaning_4
synced 2024-12-04 13:18:10 -05:00
Merge branch 'master' of https://github.com/bspeice/betterwithdata_cleaning_4
This commit is contained in:
commit
ff88efe156
@ -1,11 +1,28 @@
|
|||||||
library(shiny)
|
library(shiny)
|
||||||
|
library(ggplot2)
|
||||||
|
|
||||||
# Define server logic required to draw a histogram
|
# Define server logic required to draw a histogram
|
||||||
shinyServer(function(input, output) {
|
shinyServer(function(input, output) {
|
||||||
emergency2013 <- read.csv("./data/emergency2013.csv")
|
emergency2013 <- read.csv("./data/emergency2013.csv")
|
||||||
|
|
||||||
output$distPlot <- renderPlot({
|
output$distPlot <- renderPlot({
|
||||||
|
plot(emergency2013$duid, emergency2013$vstctgry)
|
||||||
|
})
|
||||||
|
|
||||||
|
output$mytable1 <- renderDataTable({
|
||||||
|
emergency2013[, input$show_vars, drop = FALSE]
|
||||||
|
})
|
||||||
|
|
||||||
plot(emergency2013$erdatemm, emergency2013$vstctgry)
|
output$mytable2 <- renderDataTable({
|
||||||
|
summary(emergency2013[, input$show_vars, drop = FALSE])
|
||||||
|
|
||||||
|
})
|
||||||
|
output$myplot <- renderPlot({
|
||||||
|
library(ggplot2)
|
||||||
|
library(corrplot)
|
||||||
|
pairs(emergency2013[, input$show_vars, drop = FALSE])
|
||||||
|
|
||||||
|
emergency2013[, input$show_vars, drop = FALSE]
|
||||||
|
|
||||||
})
|
})
|
||||||
})
|
})
|
@ -9,13 +9,15 @@ shinyUI(fluidPage(
|
|||||||
# Sidebar with a slider input for the number of bins
|
# Sidebar with a slider input for the number of bins
|
||||||
sidebarLayout(
|
sidebarLayout(
|
||||||
sidebarPanel(
|
sidebarPanel(
|
||||||
checkboxGroupInput('show_vars', 'Columns in dataset to show:',
|
checkboxGroupInput('show_vars', 'Columns in dataset to show:', names(emergency2013), selected = NULL)),
|
||||||
names(emergency2013), selected = names(emergency2013))
|
# Show a summary table of the selected variables
|
||||||
),
|
|
||||||
|
|
||||||
# Show a plot of the generated distribution
|
|
||||||
mainPanel(
|
mainPanel(
|
||||||
plotOutput("distPlot")
|
tabsetPanel(
|
||||||
|
id = 'dataset',
|
||||||
|
tabPanel('emergency2013', dataTableOutput('mytable1')),
|
||||||
|
tabPanel('emergency2013', dataTableOutput('mytable2')),
|
||||||
|
tabPanel('emergency2013', plotOutput('myplot')))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
))
|
)
|
||||||
|
)
|
Loading…
Reference in New Issue
Block a user