applyKMeans2D: applyKMeans2D

Description Usage Arguments Examples

View source: R/SUB_2D_applyKMeans2D.R

Description

Subroutine for applying k-means clustering based on to 2 variables. This is simply a wrapper for the kmeans() function from the stats package.

Usage

1
2
3
4
5
6
7
applyKMeans2D(
  x,
  centers = 3,
  iter.max = 100,
  nstart = 5,
  algorithm = "Hartigan-Wong"
)

Arguments

x

data frame with 2 numeric columns.

centers

number of clusters

algorithm

one of "Hartigan-Wong", "Lloyd", "Forgy", "MacQueen"

Examples

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

SOLV-Code/SPATFunctions-Package documentation built on April 25, 2020, 12:59 a.m.