-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.R
87 lines (71 loc) · 3.18 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
84
85
86
87
ui <- dashboardPage(
dashboardHeader(title = "Customer Segmentation",titleWidth = 250),
dashboardSidebar(
width = 250,
sidebarMenu(
menuItem("Data View", tabName = "DataSource", icon = icon("file")),
menuItem("Univariate Analysis", tabName = "Univariate", icon = icon("bar-chart")),
menuItem("K-means Clustering", tabName = "Kmeans", icon = icon("dot-circle-o")),
menuItem("PCA", tabName = "pca", icon = icon("sliders")),
menuItem("Results",tabName = "result", icon = icon("info-circle"))
)
),
dashboardBody(
tabItems(
tabItem(tabName = "DataSource",
# fluidRow(
# DT::dataTableOutput("AD")
# )
tabBox( title = "Data View",width = 10,
tabPanel("Data Preview",DT::dataTableOutput("AD")),
tabPanel("Data Structure", verbatimTextOutput("strData")),
tabPanel("Summary", verbatimTextOutput("sumry")),
tabPanel("Descriptive Statistics", verbatimTextOutput("ds"))
)
),
tabItem(tabName = "Univariate",
fluidRow(
box(
withSpinner(plotlyOutput(
"Univariate", height = 450, width = 850
)), width = 10
),
box(
width = 2,
selectInput("variable","Variable:", choices = NULL)
)
)
),
tabItem(tabName = "Kmeans",
fluidRow(
tabBox( title = "Optimal Cluster Number",width = 15,
tabPanel("Elbow Method", plotOutput("EM")),
tabPanel("Silhouette Analysis",
box(
sliderInput("n", "Number of Clusters", value=2, min=2, max=10)),
fluidRow(
uiOutput("plots")
)
),
tabPanel("Optimal Cluster",plotOutput("OC"),h3("Gap Statistic Method"),plotOutput("GS"),verbatimTextOutput("CL"))
)
)
),
tabItem(tabName = "pca",h3("Clustering Results using the First Two Principle Components"), box(verbatimTextOutput("pc"))
),
tabItem(tabName = "result",
fluidRow(
box(plotOutput("RS"),width=10),
box(
h6("Cluster 6 and 4 - These clusters represent the customer_data with the medium income salary as well as the medium annual spend of salary"),
h6("Cluster 1 - This cluster represents the customer_data having a high annual income as well as a high annual spend"),
h6("Cluster 3 - This cluster denotes the customer_data with low annual income as well as low yearly spend of income."),
h6("Cluster 2 - This cluster denotes a high annual income and low yearly spend."),
h6("Cluster 5 - This cluster represents a low annual income but its high yearly expenditure."),
width =10
)
),
)
)
)
)