-
Notifications
You must be signed in to change notification settings - Fork 97
/
app.R
59 lines (51 loc) · 1.35 KB
/
app.R
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
library(shiny)
library(shiny.semantic)
library(magrittr)
ui <- function() {
shinyUI(
semanticPage(
title = "Multiple checkbox example",
div(
class = "ui form",
multiple_checkbox(
"chcbx", "Select type:", c("Type one", "Type two"), c("first", "second"),
type = "slider", position = "inline"
),
actionButton("chcbx_update", "Update Checkboxes"),
textOutput("chcbx_result"),
tags$br(),
multiple_radio(
"radio", "Select type:", c("Option one", "Option two"), c("first", "second"),
"first", position = "inline"
),
actionButton("radio_update", "Update Checkboxes"),
textOutput("radio_result"),
)
)
)
}
server <- shinyServer(function(input, output, session) {
observeEvent(input$chcbx_update, {
update_multiple_checkbox(
session,
"chcbx",
choices = c("Type Three", "Type Four"),
c("third", "fourth"),
selected = c("third", "fourth"))
})
output$chcbx_result <- renderText({
input$chcbx
})
observeEvent(input$radio_update, {
update_multiple_radio(
session,
"radio",
choices = c("Option Three", "Option Four"),
c("third", "fourth"),
selected = "third")
})
output$radio_result <- renderText({
input$radio
})
})
shinyApp(ui = ui(), server = server)