Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example for Miks! #4

Open
claireh93 opened this issue Apr 18, 2019 · 0 comments
Open

Example for Miks! #4

claireh93 opened this issue Apr 18, 2019 · 0 comments

Comments

@claireh93
Copy link
Collaborator


title: "Shiny: exercise 1"
runtime: shiny

library("shiny")
## The UI
selectInput("dist_type", "Choose distribution", c("Normal", "Uniform"))
sliderInput("n", "Sample size", 10, 50, 25)
renderUI({
  if (input$dist_type == "Normal"){
  sliderInput("mean", "Mean", 1, 10, 25)
  }})
renderPlot({
  if (input$dist_type == "Normal"){
    plot(rnorm(input$n, input$mean))
  }else{
    plot(runif(input$n))
  }
})
renderText(input$n)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant