-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmatrix_test.R
More file actions
75 lines (62 loc) · 1.42 KB
/
matrix_test.R
File metadata and controls
75 lines (62 loc) · 1.42 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
library(shiny)
library(shinythemes)
library(shinyMatrix)
page_test = div(
sidebarLayout(
sidebarPanel(
width = 3,
actionButton("show", "Show modal dialog"),
),
mainPanel(
#tableOutput("table")
verbatimTextOutput("results")
)
)
)
ui = navbarPage(
title = "test",
tabPanel("matrix", page_test),
id = "navbarID",
theme = shinythemes::shinytheme("journal"), # may want to change theme
)
server = function(input, output, session) {
# actual modal
dataModal <- function(failed = FALSE) {
modalDialog(
matrixInput(
inputId = "matrix",
value = diag(5),
class = "numeric",
cols = list(
names = TRUE,
extend = TRUE,
#editableNames = TRUE,
delta = 2,
delete = TRUE
),
rows = list(
names = TRUE,
extend = TRUE,
#editableNames = TRUE,
delta = 1,
delete = TRUE
)
),
footer = tagList(
modalButton("Close"),
actionButton("ok", "OK")
)
) # modual dialogue
} # end of modal
# Show modal when button is clicked.
observeEvent(input$show, {
showModal(dataModal())
})
observeEvent(input$ok, {
#output$table = renderTable(input$matrix, rownames = TRUE)
output$results = renderPrint({
input$matrix
})
})
}
shinyApp(ui = ui, server = server)