diff --git a/shiny-app/server.R b/shiny-app/server.R new file mode 100644 index 0000000..5ee25bf --- /dev/null +++ b/shiny-app/server.R @@ -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) + }) +}) \ No newline at end of file diff --git a/shiny-app/ui.R b/shiny-app/ui.R new file mode 100644 index 0000000..8ed9e7c --- /dev/null +++ b/shiny-app/ui.R @@ -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") + ) + ) +)) \ No newline at end of file