Skip to contents

Finds k groups of clusters using the angular distance matrix

Usage

v_cluster(
  x,
  k,
  method = c("hclust", "kmeans", "diana", "agnes", "pam", "clara", "fanny"),
  ...
)

Arguments

x

object of class "Vec3", "Line", or "Plane".

k

integer. Number of desired clusters.

method

character. Clustering method to be applied. Currently implemented are

"hclust"

Hierarchical Clustering using stats::hclust(), the default)

"kmeans"

K-Means Clustering using stats::kmeans())

"pam"

Partitioning Around Medoids using cluster::pam()

"agnes"

Agglomerative hierarchical clustering using cluster::agnes()

"diana"

Divisive hierarchical clustering using cluster::diana()

"clara"

Clustering Large Applications using cluster::clara()

"fanny"

Fuzzy Analysis Clustering using cluster::fanny()

...

optional arguments passed to cluster algorithm.

Value

output of applied cluster function

See also

Examples

set.seed(20250411)
x1 <- rvmf(100, mu = Line(90, 0), k = 20)
x2 <- rvmf(100, mu = Line(0, 0), k = 20)
x3 <- rvmf(100, mu = Line(0, 90), k = 20)
x123 <- rbind(x1, x2, x3)
cl <- v_cluster(x123, k = 3)
plot(x123, col = cl$cluster)