data(iris)
selectInput("flower_choice", "Choose your flower", 
            choices = unique(iris$Species))

## unique(iris$species) is grabbing the unique values from the Species column in the iris data set. We are therefore giving the user the option to select between the different values of Species.
renderText({
  selected = iris[iris$Species == input$flower_choice,]
  mean(selected$Petal.Width)
})
renderPlot({
  selected = iris[iris$Species == input$flower_choice,]
  plot(selected$Petal.Width, selected$Petal.Length)
})


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