Description Usage Arguments Examples
View source: R/SUB_2D_applyKMeans2D.R
Subroutine for applying k-means clustering based on to 2 variables. This is simply a wrapper for the kmeans() function from the stats package.
1 2 3 4 5 6 7 | applyKMeans2D(
x,
centers = 3,
iter.max = 100,
nstart = 5,
algorithm = "Hartigan-Wong"
)
|
x |
data frame with 2 numeric columns. |
centers |
number of clusters |
algorithm |
one of "Hartigan-Wong", "Lloyd", "Forgy", "MacQueen" |
1 2 3 4 5 | test.clusters <- applyKMeans2D(SPATData_Samples[,c("SampleSW","LengthMEF")])
names(test.clusters)
test.clusters$centers
test.clusters$size
test.clusters$na.num
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.