-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.R
38 lines (29 loc) · 901 Bytes
/
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
library(shiny)
library(tidyverse)
# Define UI for application that draws a histogram
ui <- fluidPage(
# Application title
titlePanel("Werewolf Simulator"),
mainPanel(
tabsetPanel(
tabPanel("Setup",
plotOutput("plot")),
tabPanel("Game Mechanics",
verbatimTextOutput("summary")),
tabPanel("Results",
tableOutput("table"))
)
)
)
# Define server logic required to draw a histogram
server <- function(input, output) {
output$distPlot <- renderPlot({
# generate bins based on input$bins from ui.R
x <- faithful[, 2]
bins <- seq(min(x), max(x), length.out = input$bins + 1)
# draw the histogram with the specified number of bins
hist(x, breaks = bins, col = 'darkgray', border = 'white')
})
}
# Run the application
shinyApp(ui = ui, server = server)