User Tools

Site Tools


K-means Cluster Analysis


This is based on a tutorial by Prof. Hans Peter Blankholm.

Start a new R session. Import your data file containing the XY coordinates of your objects, one per line.

Graphic output

bc <- read.table("blackche.adf") <- kmeans(bc,7)
plot(bc, pch=20, col =$cluster)
symbols($centers, circles =$withinss, add, TRUE)
spatial_analysis/k-means.txt · Last modified: 2018/08/04 00:01 (external edit)