-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.R
67 lines (43 loc) · 1.4 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
60
61
62
63
64
65
66
#
# This is a Shiny web application. You can run the application by clicking
# the 'Run App' button above.
#
# Find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com/
#
library(shiny)
library(ggplot2)
# Define UI for application that draws a histogram
ui <- fluidPage(
# Application title
titlePanel("Graphs"),
# Select Box for the X axis
selectInput("selectx", label = h3("Select box"),
choices = list("Choice 1" = 1 , "Choice 2" = 2,
"Choice 3" = 3),
selected = 1),
hr(),
fluidRow(column(3, verbatimTextOutput("valuex"))),
# Select Box for the Y axis
selectInput("selecty", label = h3("Select box"),
choices = list("Choice 1" = 1, "Choice 2" = 2,
"Choice 3" = 3),
selected = 1),
hr(),
fluidRow(column(3, verbatimTextOutput("valuey"))),
# Show a plot of the generated distribution
mainPanel(
plotOutput("distPlot")
)
)
# Define server logic required to draw a histogram
server <- function(input, output) {
output$valuex <- renderPrint({ input$selectx })
output$valuey <- renderPrint({ input$selecty })
output$distPlot <- renderPlot({
plot(x=input$selectx, y=input$selecty)
})
}
# Run the application
shinyApp(ui = ui, server = server)