Created
November 7, 2013 00:24
-
-
Save annoporci/7346772 to your computer and use it in GitHub Desktop.
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
# server.R | |
library("shiny") | |
shinyServer( | |
function(input, output) { | |
myFunction <- function(myinput) | |
{ | |
# compute output | |
myoutput <- myinput*myinput | |
myoutput | |
} | |
# Show computed values | |
output$myResults <- renderText({ | |
r <- myFunction(input$myinput) | |
c("My Output:","<br><br>",r) | |
}) | |
}#end function(input,output) | |
)#end shinyServer |
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
# ui.R | |
library("shiny") | |
# Define UI for slider demo application | |
shinyUI( | |
pageWithSidebar( | |
# Title | |
headerPanel("Input-Output Shiny App") | |
, | |
# User Input | |
sidebarPanel( | |
# customize display settings | |
tags$head( | |
tags$style(type='text/css', "input { width: 80%; }")# control numericInput box | |
) | |
, | |
# user input | |
numericInput("myinput", "My Input:", 0) | |
)# end sidebarPanel | |
, | |
# Output | |
mainPanel( | |
HTML('<style type="text/css"> | |
.row-fluid { width: 50%; } | |
.well { background-color: #99CCFF; } | |
.shiny-html-output { font-size: 20px; line-height: 21px; } | |
</style>') | |
, | |
wellPanel( | |
# See output$myResults in server.R | |
tableOutput("myResults") | |
)#end wellPanel | |
)# end mainPanel | |
)#end pageWithSidebar | |
)#end shinyUI |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment