Skip to content

Instantly share code, notes, and snippets.

@tcash21
Last active December 25, 2015 03:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tcash21/6911207 to your computer and use it in GitHub Desktop.
Save tcash21/6911207 to your computer and use it in GitHub Desktop.
From Big Data meetup 10-9-2013
.well {
width: 250px;
}
library(shiny)
shinyServer(function(input, output) {
output$plotOut <- renderPlot({
hist(faithful$eruptions, breaks=as.numeric(input$nBreaks))
if(input$individualObs){
rug(faithful$eruptions)
}
})
output$tableOut <- renderTable({
if(input$individualObs){
faithful
}
else{
NULL
}
})
})
# Application title
customHeaderPanel <- function(title,windowTitle=title){
tagList(
tags$head(
tags$title(windowTitle),
tags$link(rel="stylesheet", type="text/css",
href="app.css")
),
div(class = "span12", style = "padding: 10px 0px;", h1(title))
)
}
shinyUI(pageWithSidebar(
customHeaderPanel(title="Test"),
sidebarPanel(
numericInput("nBreaks", "Number of Breaks", 10),
checkboxInput("individualObs", "Show Individual Observations", FALSE)
),
mainPanel(
plotOutput('plotOut', width=700),
tableOutput('tableOut')
))
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment