mirror of
				https://github.com/bspeice/betterwithdata_cleaning_4
				synced 2025-11-03 18:00:58 -05:00 
			
		
		
		
	Merge remote-tracking branch 'origin/master'
Conflicts: shiny-app/server.R
This commit is contained in:
		@ -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)
 | 
			
		||||
 | 
			
		||||
@ -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'))))
 | 
			
		||||
    )
 | 
			
		||||
  )
 | 
			
		||||
))
 | 
			
		||||
)
 | 
			
		||||
		Reference in New Issue
	
	Block a user