forked from VictorTong7/Universal-Bioinformatics-Platform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTest.R
42 lines (31 loc) · 1.15 KB
/
Test.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
library(shiny)
ui <- fluidPage(
textInput("keywords", "Enter keywords"),
verbatimTextOutput("keywords"),
textInput("category_1", "Set Category 1"),
verbatimTextOutput("category1"),
textInput("category_2", "Set Category 2"),
verbatimTextOutput("category2"),
textInput("category_3", "Set Category 3"),
verbatimTextOutput("category3"),
selectInput("variable","Variable:",
c("category1" = input$category_1,
"category2" = input$category_2,
"category3" = input$category_3,
"Not included" = "wt")),
dataTableOutput("data"),
tableOutput("results")
)
server <- function(input, output) {
output$keywords <- renderText({input$keywords})
output$category1 <- renderText({input$category_1})
output$category2 <- renderText({input$category_2})
output$category3 <- renderText({input$category_3})
output$data <- renderDataTable({
mtcars[, c("mpg", input$variable), drop = FALSE]
})
output$results <- renderTable({
mtcars[, c("mpg", input$keywords), drop = TRUE]
}, rownames = TRUE)
}
shinyApp(ui = ui, server = server)