Hi. I am new to Shiny. I have a data where 3 filters are to be made- Region, cluster and schools. When I select a particular region, the relevant clusters must only appear and when i select the cluster, only the relevant schools must appear. Thank you in advance.
library(tidyverse)
library(shiny)
library(shinydashboard)
#>
#> Attaching package: 'shinydashboard'
#> The following object is masked from 'package:graphics':
#>
#> box
data<-tibble::tribble(
~region, ~cluster, ~school,
"Hubballi City", "BAIRIDEVARKOPPA", "GLPS Sadashivanand Nagar BAIRIDEVARKOPPA",
"Dharwad Rural", "NARENDRA", "GHPS KANNADA GIRLS NARENDRA, NARENDRA",
"Dharwad Rural", "NARENDRA", "GHPS MULAMUTTAL, NARENDRA",
"Hubballi City", "GOPANAKOPPA", "KARNATAKA PUBLIC SCHOOLS GMPS GOPANAKOPPA",
"Hubballi City", "GOPANAKOPPA", "GHPS BENGERI",
"Hubballi City", "GOPANAKOPPA", "KARNATAKA PUBLIC SCHOOLS GMPS GOPANAKOPPA",
"Hubballi City", "GOPANAKOPPA", "KARNATAKA PUBLIC SCHOOLS GMPS GOPANAKOPPA",
"Hubballi City", "INDIPUMP", "GMKBGS NO.01 OLD HUBBALLI",
"Hubballi Rural", "NOOLVI", "GHPKBS NOOLVI, NOOLVI",
"Dharwad Rural", "NARENDRA", "GHPS KURUBAGATTI, NARENDRA",
"Hubballi City", "BAIRIDEVARKOPPA", "GLPS Sadashivanand Nagar BAIRIDEVARKOPPA",
"Hubballi City", "BAIRIDEVARKOPPA", "GLPS Sadashivanand Nagar BAIRIDEVARKOPPA",
"Hubballi City", "GOKUL", "GHPS MANJUNATH NAGAR HUBLI, ANAND NAGAR HBL",
"Hubballi Rural", "NOOLVI", "GHPKBS NOOLVI, NOOLVI",
"Dharwad Rural", "NARENDRA", "GHPS KANNADA GIRLS NARENDRA, NARENDRA",
"Hubballi Rural", "KUNDGOL", "GMPS, ADARAGUNCHI",
"Dharwad City", "MALAMADDI", "LPS LAKSHMI SINGANAKERI, MALAMADDI",
"Hubballi City", "NAVANAGAR", "GMGS AMARGOL",
"Hubballi Rural", "NOOLVI", "GLPS SHEREWAD PLOT, NOOLVI",
"Hubballi Rural", "NOOLVI", "GHPKBS NOOLVI, NOOLVI",
"Hubballi Rural", "NOOLVI", "GHPKBS NOOLVI, NOOLVI",
"Dharwad City", "GANDHI CHWOKA, DWD", "GHPS NO.8 GANDHI CHOUK DHARWAD",
"Dharwad Rural", "DEVARHUBBALI", "GHPS MANSUR DICE NUMBER-29090108001",
"Hubballi Rural", "RAYNAL", "GOVERNMENT HIGHER PRIMARY SCHOOL Channapura"
)
ui<-dashboardPage(
skin="red",
dashboardHeader(title = "EarlySpark Assessments Dashboard for Level-1 (Age 6)",titleWidth = 600),
dashboardSidebar("Select the Inputs here", width = 300,
selectInput("region","Select the region",choices = sort(unique(data$region)),selected = "Hubballi Rural"),
selectInput("cluster","Select the cluster",choices = sort(unique(data$cluster)),multiple = T),
selectInput("school","select the school name",choices = sort(unique(data$school)),multiple = T)),
dashboardBody(
tabsetPanel(type="tabs",
id="tab_selected",
tabPanel(title="Dashboard for Level-1"))
)
)
server<-function(input,output){}
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-03-29 by the reprex package (v2.0.1)