[R] shinyWidgets::sliderTextInput

Sigbert Klinke @|gbert @end|ng |rom w|w|@hu-ber||n@de
Fri Aug 9 08:25:36 CEST 2019


Hi Erin,

do you see the difference between sliderTextInput and selectInput? I 
would like to have the selectInput behaviour (list element name in 
display, but result as value of list element) in sliderTextInput as well.

Best Sigbert

---

library("shiny")
library("shinyWidgets")

ui <- fluidPage(
   br(),
   sliderTextInput(
     inputId = "mySliderText",
     label = "My House",
     choices = list("choice 1" = 1,"choice 2" =2,
                    "choice 3" = 3)
   ),
   selectInput(inputId="slope", label="selectInput",
                choices=list("Choice 1" = "A","Choice 2" = "B",
                             "Choice 3" = "C")),
   verbatimTextOutput(outputId = "result")
)


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

   output$result <- renderPrint({
     str(input$mySliderText)
     str(input$slope)
   })
}

shinyApp(ui = ui, server = server)


-- 
https://hu.berlin/sk
https://hu.berlin/mmstat3



More information about the R-help mailing list