mirror of
https://github.com/bspeice/betterwithdata_cleaning_4
synced 2024-12-04 21:28:09 -05:00
Merge branch 'master' of https://github.com/bspeice/betterwithdata_cleaning_4
This commit is contained in:
commit
1cc6af83c0
@ -3,26 +3,46 @@ library(ggplot2)
|
||||
|
||||
# Define server logic required to draw a histogram
|
||||
shinyServer(function(input, output) {
|
||||
#datasets <- list.files('./data/')
|
||||
emergency2013 <- read.csv("./data/emergency2013.csv")
|
||||
|
||||
|
||||
|
||||
output$fileSelect <- renderUI({
|
||||
selectInput("dataSetInput", "Choose your survey:", list.files('./data/'))
|
||||
})
|
||||
|
||||
#currentDataset <- read.csv(paste0('./data/', input$dataSetInput))
|
||||
|
||||
output$columnList <- renderUI({
|
||||
currentDataset <- read.csv(paste0('./data/', input$dataSetInput, sep=''))
|
||||
checkboxGroupInput('show_vars', 'Columns in dataset to show:', names(currentDataset), selected = NULL)
|
||||
})
|
||||
|
||||
|
||||
|
||||
output$distPlot <- renderPlot({
|
||||
plot(emergency2013$duid, emergency2013$vstctgry)
|
||||
currentDataset <- read.csv(paste0('./data/', input$dataSetInput, sep=''))
|
||||
plot(currentDataset$duid, currentDataset$vstctgry)
|
||||
})
|
||||
|
||||
output$mytable1 <- renderDataTable({
|
||||
emergency2013[, input$show_vars, drop = FALSE]
|
||||
currentDataset <- read.csv(paste0('./data/', input$dataSetInput, sep=''))
|
||||
currentDataset[, input$show_vars, drop = FALSE]
|
||||
})
|
||||
|
||||
output$mytable2 <- renderDataTable({
|
||||
summary(emergency2013[, input$show_vars, drop = FALSE])
|
||||
currentDataset <- read.csv(paste0('./data/', input$dataSetInput, sep=''))
|
||||
summary(currentDataset[, input$show_vars, drop = FALSE])
|
||||
|
||||
})
|
||||
output$myplot <- renderPlot({
|
||||
currentDataset <- read.csv(paste0('./data/', input$dataSetInput, sep=''))
|
||||
library(ggplot2)
|
||||
library(corrplot)
|
||||
pairs(emergency2013[, input$show_vars, drop = FALSE])
|
||||
pairs(currentDataset[, input$show_vars, drop = FALSE])
|
||||
|
||||
emergency2013[, input$show_vars, drop = FALSE]
|
||||
currentDataset[, input$show_vars, drop = FALSE]
|
||||
|
||||
})
|
||||
})
|
@ -9,14 +9,16 @@ 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)),
|
||||
uiOutput('fileSelect'),
|
||||
uiOutput('columnList')
|
||||
),
|
||||
# Show a summary table of the selected variables
|
||||
mainPanel(
|
||||
tabsetPanel(
|
||||
id = 'dataset',
|
||||
tabPanel('emergency2013', dataTableOutput('mytable1')),
|
||||
tabPanel('emergency2013', dataTableOutput('mytable2')),
|
||||
tabPanel('emergency2013', plotOutput('myplot')))
|
||||
tabPanel('Data Table', dataTableOutput('mytable1')),
|
||||
tabPanel('Summary Statistics', dataTableOutput('mytable2')),
|
||||
tabPanel('Scatter Plots', plotOutput('myplot')))
|
||||
)
|
||||
)
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user