mirror of
https://github.com/bspeice/betterwithdata_cleaning_4
synced 2024-12-04 21:28:09 -05:00
Customize datasets
This commit is contained in:
parent
2627c1d12f
commit
0a09137353
@ -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,7 +9,9 @@ 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(
|
||||
|
Loading…
Reference in New Issue
Block a user