Created
November 9, 2012 13:54
-
-
Save yoavram/4045750 to your computer and use it in GitHub Desktop.
Shiny app of a Random Graph Plot. Requirements: Shiny (http://www.rstudio.com/shiny/) and Rgraphviz (http://www.bioconductor.org/packages/2.11/bioc/html/Rgraphviz.html). This app is deployed at http://glimmer.rstudio.com/yoavram/RandomGraphPlot/
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) # http://rstudio.github.com/shiny/tutorial/#hello-shiny | |
library(Rgraphviz) # http://www.bioconductor.org/packages/2.11/bioc/html/Rgraphviz.html | |
shinyServer(function(input, output) { | |
output$graphPlot <- reactivePlot(function() { | |
g <- randomGraph(1:input$V, 1:input$M, input$p) | |
plot(g) | |
}) | |
}) |
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) | |
shinyUI(pageWithSidebar( | |
headerPanel("Shiny Random Graph"), | |
sidebarPanel( | |
sliderInput("V", | |
"Number of nodes:", | |
min = 1, | |
max = 100, | |
value = 10), | |
sliderInput("M", | |
"M:", | |
min = 1, | |
max = 10, | |
value = 4), | |
sliderInput("p", | |
"p:", | |
min = 0, | |
max = 1, | |
value = 0.5), | |
helpText("Code available at https://gist.github.com/4045750") | |
), | |
mainPanel( | |
plotOutput("graphPlot") | |
) | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment