forked from henvic/accidents
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.R
83 lines (76 loc) · 2.17 KB
/
ui.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
library(shiny);
graphsAvailable <- c(
"Histogram",
"Normal distribution",
"Hypothesis test",
"Qualitative"
);
hypothesisTestTypeAvailable <- c(
"two.sided",
"greater",
"less"
);
hypothesisTestSamples <- c(
"one",
"two"
);
frequencyFunctionAvailable <- c("square", "sturges", "scott", "FD");
qualitativeGraph <- c(
"pie",
"bar"
);
shinyUI(fluidPage(
headerPanel("Workplace accidents in brazilian states"),
sidebarLayout(
sidebarPanel(
selectInput("dataset", "Dataset", choices = dir("data/")),
selectInput("graph", "Graph", choices = graphsAvailable),
conditionalPanel(
condition = "input.graph == 'Normal distribution' ||
input.graph == 'Hypothesis test'",
sliderInput("confidence",
"Confidence interval",
min = 0.75,
max = 0.99,
step = 0.01,
value = 0.95)
),
conditionalPanel(
condition = "input.graph == 'Hypothesis test'",
radioButtons("hypothesisTestSamples", "Hypothesis Test samples",
hypothesisTestSamples),
radioButtons("hypothesisTestType", "Hypothesis Test type",
hypothesisTestTypeAvailable)
),
conditionalPanel(
condition = "input.graph == 'Histogram'",
sliderInput("bins",
"Number of bins for histogram",
min = 1,
max = 40,
value = 5)
),
conditionalPanel(
condition = "input.graph == 'Qualitative'",
radioButtons("plot", "Plot type", choices = qualitativeGraph),
hr(),
h2("Qualitative Frequency"),
tableOutput("distQualitativeTable")
),
conditionalPanel(
condition = "input.graph != 'Qualitative'",
radioButtons("frequencyFunction", "Interval function",
frequencyFunctionAvailable),
hr(),
h2("Frequency table"),
tableOutput("distTable")
),
htmlOutput("about")
),
mainPanel(
verbatimTextOutput("distProperties"),
plotOutput("distPlot"),
textOutput("distPlotNotes")
)
)
));