library("shiny")
## The UI sliderInput("n", "Sample size", 10, 50, 25) selectInput("dist", "Distribution", c("Uniform", "Normal")) actionButton("plot", "Plot it")
get_data = function(n, dist) { if(dist=="Uniform") runif(n) else rnorm(n) } data = reactive(get_data(input$n, input$dist)) renderPlot(plot(data())) renderText(max(data()))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.