https://eg7649.shinyapps.io/developingDataProducts
SEAN HUANG
It is the real dataset about the students' knowledge status about the subject of Electrical DC Machines. The dataset had been obtained from Ph.D. Thesis.
Attribute information
You can download the dataset here.
shinyServer(function(input, output, session) {
selectedData <- reactive({
data[, c(input$xcol, input$ycol)] }) # select data accroding to user input
clusters <- reactive({
kmeans(selectedData(), input$clusters) }) # do the calculation
output$plot1 <- renderPlot({ # print colorful result
par(mar = c(5.1, 4.1, 0, 1))
plot(selectedData(), col = clusters()$cluster, pch = 20, cex = 3)
points(clusters()$centers, pch = 13, cex = 3, lwd = 4, col = "#CC00CD") })
})
Choose STG vs. STR
4 cluster
selectedData <- data[, c(1,3)]
clusters <- kmeans(selectedData, 4)
par(mar = c(5.1, 4.1, 0, 1))
plot(selectedData, col = clusters$cluster, pch = 20, cex = 3)
points(clusters$centers, pch = 13, cex = 3, lwd = 4, col = "#CC00CD")
Choose SCG vs. STR
2 cluster
selectedData <- data[, 2:3]
clusters <- kmeans(selectedData, 2)
par(mar = c(5.1, 4.1, 0, 1))
plot(selectedData, col = clusters$cluster, pch = 20, cex = 3)
points(clusters$centers, pch = 13, cex = 3, lwd = 4, col = "#CC00CD")