Derek Luo
2017.6.22
This is a presentation for the Coursera Project of “Developing Data Products”. I got most of the codes from the Shiny Gallery for “Iris K-means Clustering”. It's quite a good example of showing the combination of algorithms and shiny apps.
The shiny app can be accessed as following: http://derekluo.shinyapps.io/course_project_shiny_application/
For the first four variables, we can see how the combinations as we choose for x and y. Also we can see the change of the k-means clustering by assigning different Cluster Count.
str(iris)
'data.frame': 150 obs. of 5 variables:
$ Sepal.Length: num 5.1 4.9 4.7 4.6 5 5.4 4.6 5 4.4 4.9 ...
$ Sepal.Width : num 3.5 3 3.2 3.1 3.6 3.9 3.4 3.4 2.9 3.1 ...
$ Petal.Length: num 1.4 1.4 1.3 1.5 1.4 1.7 1.4 1.5 1.4 1.5 ...
$ Petal.Width : num 0.2 0.2 0.2 0.2 0.2 0.4 0.3 0.2 0.2 0.1 ...
$ Species : Factor w/ 3 levels "setosa","versicolor",..: 1 1 1 1 1 1 1 1 1 1 ...
Beautiful app for the classic data set!
For the original code of this app, the variable “Species” will cause some error because it's not being need for the algorithm.
So I did a little correction in ui.R so that all the things works well.
selectInput('xcol', 'X Variable', names(iris[,1:4])),
selectInput('ycol', 'Y Variable', names(iris[,1:4]),