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()
})


jr-packages/jrShiny documentation built on Feb. 16, 2020, 9:13 p.m.