From 34a3037325c2bca220fead584e54521f1a14fbf5 Mon Sep 17 00:00:00 2001 From: Aron Lindberg Date: Sat, 7 Nov 2015 11:50:03 -0500 Subject: [PATCH] first commit of web app --- shiny-app/server.R | 16 ++++++++++++++++ shiny-app/ui.R | 24 ++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 shiny-app/server.R create mode 100644 shiny-app/ui.R 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