-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathui.R
More file actions
63 lines (56 loc) · 2.47 KB
/
ui.R
File metadata and controls
63 lines (56 loc) · 2.47 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
ui <- fluidPage(
titlePanel("Occupation, Stress, and Sleep Quality"),
sidebarLayout(
sidebarPanel(
selectInput("occupation", "Select Occupation", choices = c(unique(data$Occupation), "Everyone"), selected = "Everyone"),
selectInput("gender", "Select Gender", choices = c(unique(data$Gender), "Everyone"), selected = "Everyone"),
sliderInput("age_range", "Select Age Range",
min = min(data$Age),
max = max(data$Age),
value = c(min(data$Age), max(data$Age)),
step = 4)),
mainPanel(
plotOutput("plot"),
textOutput("lowest_quality_occupation_view"),
tags$br(), tags$br(),
fluidRow(
column(width = 6, plotlyOutput("pie_chart", width = "100%", height = 450)),
column(width = 6, plotlyOutput("boxplot", width = "100%", height = 450))
),
tags$br(), tags$br(),
plotlyOutput("heatmap"),
tags$br(), tags$br()
)
),
sidebarLayout(
sidebarPanel(
selectInput("first_variable", "Select First Variable For Clustering",
choices = setdiff(colnames(data), c("state", "code", "Gender", "Age", "Occupation", "BMI.Category", "Blood.Pressure", "Person.ID", "Sleep.Disorder")),
selected = "Stress.Level"),
selectInput("second_variable", "Select Second Variable For Clustering",
choices = setdiff(colnames(data), c("state", "code", "Gender", "Age", "Occupation", "BMI.Category", "Blood.Pressure", "Person.ID", "Sleep.Disorder")),
selected = "Physical.Activity.Level"),
sliderInput("num_clusters", "Number of Clusters To Form", min = 2, max = 10, value = 3),
sliderInput("desired_clusters", "Desired (Optimal) Number of Clusters", min = 2, max = 10, value = 3)
),
mainPanel(
h4("Additional Information:"),
p("This section provides insights into cluster analysis."),
tags$br(), tags$br(),
fluidRow(
column(width = 6, plotOutput("dendrogram_plot", width = "100%")),
column(width = 6, plotOutput("cluster_plot", width = "100%"))
)
)
),
tags$br(), tags$br(),
sidebarLayout(
sidebarPanel(
selectInput("variable", "Select a variable to observe on the map:",
choices = c("Quality.of.Sleep", "Sleep.Duration", "Physical.Activity.Level", "Stress.Level", "Daily.Steps", "Heart.Rate")),
),
mainPanel(
plotlyOutput("choroplethMap")
)
)
)