FreddyHernandez commited on
Commit
d2f9349
verified
1 Parent(s): d5e1b87

Create ui.R

Browse files
Files changed (1) hide show
  1. ui.R +16 -0
ui.R ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # k-means only works with numerical variables,
2
+ # so don't give the user the option to select
3
+ # a categorical variable
4
+ vars <- setdiff(names(iris), "Species")
5
+
6
+ pageWithSidebar(
7
+ headerPanel('Iris k-means clustering'),
8
+ sidebarPanel(
9
+ selectInput('xcol', 'X Variable', vars),
10
+ selectInput('ycol', 'Y Variable', vars, selected = vars[[2]]),
11
+ numericInput('clusters', 'Cluster count', 3, min = 1, max = 9)
12
+ ),
13
+ mainPanel(
14
+ plotOutput('plot1')
15
+ )
16
+ )