In the shiny
app below when all pickerInput()
choices are selected then instead of their names as choices inside the pickerInput()
I would like to display the word "all"
as choice and when you click on it, then all three choices shall be displayed. If we can make it work with selectInput()
no problem but the printed output should not be affected. How can I do it?
library(shiny)
library(shinyWidgets)
ui <- fluidPage(
uiOutput("pick"),
verbatimTextOutput("PR")
)
server <- function(input, output, session) {
output$pick<-renderUI({
pickerInput(
inputId = "p9",
label = "Health Insurance",
choices = unique(as.character(iris$Species)),
width = "150px",
selected = unique(as.character(iris$Species)),
multiple = TRUE,
options = list(
`actions-box` = TRUE,
`deselect-all-text` = "None",
`select-all-text` = "All",
`none-selected-text` = "zero"
)
)
})
output$PR<-renderPrint({
input$p9
})
}
shinyApp(ui, server)