I have created two different filters and I will like to develop a dynamic filter. If the dataset doesn't have one value the second/first filter must eliminate the other value from the filter. Do I need to use an observeEvent? But where?
For example, I have used the iris dataset and if I select Species setosa I will like to see only 0.1, 0.2, 0.3 etc.
library(shiny)
library(dplyr)
library(DT)
library(ggplot2)
shinyUI (fluidPage(
navbarPage("My Application",
tabPanel("First",
tabPanel("Per Famiglia Prodotto",
selectInput("Specie", "Per specie", choices = unique(iris$Species)),
tabPanel("Classe2",
selectInput("classe2", "Classe2", choices = unique(iris$Petal.Width)),
)
)
)
)
)
)
shinyServer(
function(input, output, session) {
iris
classe <- reactive({
filter(iris, iris$Species == input$classe)})
classe2 <- reactive({
filter(Dato, iris$Petal.Width == input$classe2)
})
})