Created
March 7, 2016 23:56
-
-
Save ashutoshnanda/af5b547994ab967c0ac4 to your computer and use it in GitHub Desktop.
DataSpace Code for March 7th, 2016 - Shiny!!
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
shinyServer(function(input, output) { | |
output$selectvalue <- renderPrint( | |
3 * as.numeric(input$myselectinput) + 5 | |
) | |
output$slidervalue <- renderPrint( | |
input$mysliderinput * as.numeric(input$myselectinput) | |
) | |
output$plot <- renderPlot( | |
hist(rnorm(100, mean = input$mysliderinput)) | |
) | |
}) |
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
#For publishing online: http://shiny.rstudio.com/articles/shinyapps.html | |
shinyUI(fluidPage( | |
titlePanel("My Shiny App Here"), | |
sidebarLayout( | |
sidebarPanel( | |
h3("Sidebar"), | |
#http://shiny.rstudio.com/tutorial/lesson3/ | |
selectInput("myselectinput", | |
label = "Pick A Value", | |
choices = c("First" = 1, | |
"Second" = 2, | |
"Third" = 3)), | |
sliderInput("mysliderinput", | |
label = "Slide me!", | |
min = 0, | |
max = 10, | |
value = 3, #c(5, 7) | |
step = 0.1) | |
), | |
mainPanel( | |
h3("Main"), | |
textOutput("selectvalue"), | |
textOutput("slidervalue"), | |
plotOutput("plot") | |
) | |
) | |
#h1("My Title"), | |
#hr(), | |
#em("italicize me"), | |
#br(), | |
#strong("bold me") | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment