lundi 18 janvier 2021

Compare user input with grouped data

I want to plot data with a combination of 2 "selectInputs" to choose from. First stage would be "big" or "small", second stage would be the breed. So I grouped various colums with this function and it will summarise the amount of dogs.

filterMethod <- reactive({
if(input$dropdown1=="small"){
  data <- rawData %>%  group_by(breed, name, ID, color) %>%
    summarise(AmountDogs = sum(AmountDogs))
}

I created various inputs, for example a selectInput with the breeds to choose from so the user has options that are set. Now I want to plot the data if the user choose "Terrier" for example.

 if(input$dropdown1=="small"){
  plot <- ggplot(data=filterMethod() ??? if $breed==input$breed ???
  }

Thank you guys in advance!

Aucun commentaire:

Enregistrer un commentaire