the given script creates the attached snapshot.It is a table created using DT package in R. I want to make the menu above the table such that by selecting an input "A" in the first SelectInput, I get the second selectInput with two sliders, while selecting "B" in the first SelectInput, I should get only the second SelectInput and no sliders. There is no change needed on the table iris. Please help and Thanks.
## app.R ##
library(shiny)
library(shinydashboard)
library(DT)
#Declaring the UI
ui <- fluidPage(
titlePanel("Interactive Menu"),
# Create a new Row in the UI for selectInputs
fluidRow(
column(3,
selectInput("names",
"Customer:",
c("A","B"))
)),
fluidRow(
column(4,
selectInput("names",
"Customer:",
c(as.character(iris$Species)))
),
column(4,
sliderInput("slide", "Select the slider one",
min = 75, max = 100,
value = 75, step = 5)
),
column(4,
sliderInput("city", "Select the slider two",
min = 60, max = 100,
value = 60, step = 10)
)),
# Create a new row for the table.
fluidRow(
DT::dataTableOutput("table1")
)
)
#Declaring the Server
server <- function(input, output) {
# Filter data based on selections
output$table1 <- renderDataTable({
datatable(iris, options = list(
searching = FALSE,
pageLength = 5,
lengthMenu = c(5, 10, 15, 20)
))
})
}
shinyApp(ui, server)