wired_radio: Wired Radio Buttons

Description Usage Arguments Examples

View source: R/inputs.R

Description

Wired Radio Buttons

Usage

1
wired_radio(inputId, label, choices, selected = NULL, width = NULL)

Arguments

inputId

The input slot that will be used to access the value.

label

Display label for the control, or NULL for no label.

choices

List of values to select from. If elements of the list are named, then that name rather than the value is displayed to the user.

selected

The initially selected value. If not specified then defaults to the first value.

width

The width of the input, e.g. 400px, or 100%; see validateCssUnit.

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
if (interactive()) {

  library(shiny)
  library(wired)

  ui <- fluidPage(
    wired_radio(
      inputId = "radi", label = "Radio buttons:",
      choices = c("Normal" = "norm",
                  "Uniform" = "unif",
                  "Log-normal" = "lnorm",
                  "Exponential" = "exp")
    ),
    verbatimTextOutput(outputId = "res")
  )

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

    output$res <- renderPrint(input$radi)

  }

  shinyApp(ui, server)

}

dreamRs/wired documentation built on Nov. 19, 2019, 5 a.m.