library("ggplot2") library("tibble") ## The UI sliderInput("n", "Sample size", 10, 50, 25) actionButton("uniform", "Uniform") actionButton("normal", "Normal") rvs = reactiveValues(data = enframe(1:10))
observeEvent(input$uniform, { rvs$data = enframe(runif(input$n)) }) observeEvent(input$normal, { rvs$data = enframe(rnorm(input$n)) }) renderPlot({ ggplot(rvs$data, aes(x = name, y = value)) + geom_point() })
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.