[英]R Shiny input slider range values
I have a slider input type of 'range' in my Shiny app and I would like to get the minimum and maximum values selected by the user in my server.R 我在Shiny应用程序中的滑块输入类型为“范围”,我想获取用户在服务器中选择的最小值和最大值。
in my ui.RI have 在我的ui.RI中
sliderInput("range", "Age:",
min = 0, max = 100, value = c(0,100))
and I would like to get the selected values not min and max that I have defined 我想获得所选的值,而不是我定义的最小值和最大值
You can access the slider ranges using input$range[1]
for min and input$range[2]
for max 您可以使用
input$range[1]
(最小值)和input$range[2]
(最大值)来访问滑块范围
library(shiny)
ui <- basicPage(sliderInput("range", "Age:",min = 0, max = 100, value = c(0,100)),textOutput("SliderText"))
server <- shinyServer(function(input, output, session){
my_range <- reactive({
cbind(input$range[1],input$range[2])
})
output$SliderText <- renderText({my_range()})
})
shinyApp(ui = ui, server = server)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.