numRangeInput: Create numeric range input

Description Usage Examples

Description

Create an input control for numeric range values

Usage

1
2
numRangeInput(inputId, label = NULL, start = "", end = "", min = NULL,
  max = NULL, format = "#,###", separator = "to", width = NULL)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
if (interactive()) {
library(shiny)
library(shinydashboard)
shinyApp(
  ui = fluidPage({
    title = "Num Range Input"
    fluidRow(
      numRangeInput("num", label = "数值:", start = 12, end = 20000),
      sliderInput("obs", "Number of observations:", min = 0, max = 2000, value = c(13,1900)),
      actionButton("update", label = "Update"),
      verbatimTextOutput("value1"),
      verbatimTextOutput("value2")
    )
  }),
  server = function(input, output, session) {
    output$value1 <- renderText({
      paste(input$num_1,input$num_2)
    })
    observeEvent(input$update, {
      updatenumRangeInput(session, "num", range = 1, value = list(input$obs[[1]]))
      updatenumRangeInput(session, "num", range = 2,value = list(input$obs[[2]]))
    })
    output$value2 <- renderText({
      input$obs
    })
  }
)
}

jeevanyue/ShinyFuncs documentation built on May 24, 2019, 7:14 a.m.