Last active
December 25, 2015 03:39
-
-
Save tcash21/6911207 to your computer and use it in GitHub Desktop.
From Big Data meetup 10-9-2013
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.well { | |
width: 250px; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} | |
}) | |
}) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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