Applying different filters in different tabs in shiny

Hi,
I need to build a shiny app with analysis at two levels- at Master Trainer and Teacher levels. I have two tabs for it, one for each. But in the case of filters, I need only master trainer in first tab and teacher in the second tab. Is it possible to do?

library(tidyverse)
library(shiny)
library(shinydashboard)
#> 
#> Attaching package: 'shinydashboard'
#> The following object is masked from 'package:graphics':
#> 
#>     box
data<-tibble::tribble(
        ~master,     ~teacher, ~score,
            "A",     "Gandhi",    39L,
            "A",      "Nehru",    46L,
            "A",      "Patel",    36L,
            "B",      "Kiran",    37L,
            "B",      "Obama",    46L,
            "B", "Fitzgerald",    36L,
            "C",       "Azad",    41L,
            "C",   "Reginals",    35L,
            "C",      "Dwyer",    41L
        )

ui<-dashboardPage(
  skin = "blue",
  dashboardHeader(title = "Test"),
  dashboardSidebar("Choose your inputs here",
                   selectInput("master","Select the master trainer",choices = unique(data$master)),
                   selectInput("teacher","Select the Teacher",choices = data$teacher)),
  dashboardBody(
    tabsetPanel(
      tabPanel(title = "First tab",plotOutput("plot1")),
      tabPanel(title = "Second tab",plotOutput("plot2")))
  )
)

server<-function(input,output,session){
  
}

shinyApp(ui,server)
#> PhantomJS not found. You can install it with webshot::install_phantomjs(). If it is installed, please make sure the phantomjs executable can be found via the PATH variable.
Shiny applications not supported in static R Markdown documents
Created on 2022-10-19 by the reprex package (v2.0.1)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.