mirror of
				https://github.com/bspeice/betterwithdata_cleaning_4
				synced 2025-11-03 18:00:58 -05:00 
			
		
		
		
	first commit of web app
This commit is contained in:
		
							
								
								
									
										16
									
								
								shiny-app/server.R
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								shiny-app/server.R
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,16 @@
 | 
			
		||||
library(shiny)
 | 
			
		||||
 | 
			
		||||
# Define server logic required to draw a histogram
 | 
			
		||||
shinyServer(function(input, output) {
 | 
			
		||||
  
 | 
			
		||||
  # Expression that generates a histogram. The expression is
 | 
			
		||||
  # wrapped in a call to renderPlot to indicate that:
 | 
			
		||||
  #
 | 
			
		||||
  #  1) It is "reactive" and therefore should re-execute automatically
 | 
			
		||||
  #     when inputs change
 | 
			
		||||
  #  2) Its output type is a plot
 | 
			
		||||
  
 | 
			
		||||
  output$distPlot <- renderPlot({
 | 
			
		||||
   plot(faithful$eruptions, faithful$waiting)
 | 
			
		||||
  })
 | 
			
		||||
})
 | 
			
		||||
							
								
								
									
										24
									
								
								shiny-app/ui.R
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								shiny-app/ui.R
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,24 @@
 | 
			
		||||
library(shiny)
 | 
			
		||||
 | 
			
		||||
# Define UI for application that draws a histogram
 | 
			
		||||
shinyUI(fluidPage(
 | 
			
		||||
  
 | 
			
		||||
  # Application title
 | 
			
		||||
  titlePanel("Hello Shiny!"),
 | 
			
		||||
  
 | 
			
		||||
  # Sidebar with a slider input for the number of bins
 | 
			
		||||
  sidebarLayout(
 | 
			
		||||
    sidebarPanel(
 | 
			
		||||
      sliderInput("bins",
 | 
			
		||||
                  "Number of bins:",
 | 
			
		||||
                  min = 1,
 | 
			
		||||
                  max = 50,
 | 
			
		||||
                  value = 30)
 | 
			
		||||
    ),
 | 
			
		||||
    
 | 
			
		||||
    # Show a plot of the generated distribution
 | 
			
		||||
    mainPanel(
 | 
			
		||||
      plotOutput("distPlot")
 | 
			
		||||
    )
 | 
			
		||||
  )
 | 
			
		||||
))
 | 
			
		||||
		Reference in New Issue
	
	Block a user