print.clustering.sc.dp: Print the result returned by calling clustering.sc.dp

View source: R/clustering.sc.dp.R

print.clustering.sc.dpR Documentation

Print the result returned by calling clustering.sc.dp

Description

Print the result returned by calling clustering.sc.dp

Usage

## S3 method for class 'clustering.sc.dp'
print(x, ...)

Arguments

x

object returned by calling clustering.sc.dp()

...

ignored arguments

Value

An object of class 'clustering.sc.dp' which has a print method and is a list with components:

cluster

A vector of integers (1:k) indicating the cluster to which each point is allocated.

centers

A matrix whose rows represent cluster centres.

withinss

The within-cluster sum of squares for each cluster.

size

The number of points in each cluster.

Author(s)

Tibor Szkaliczki szkaliczki.tibor@sztaki.hu

Examples

# Example: clustering data generated from a random walk
x<-matrix(, nrow = 100, ncol = 2)
x[1,]<-c(0,0)
for(i in 2:100) {
  x[i,1]<-x[i-1,1] + rnorm(1,0,0.1)
  x[i,2]<-x[i-1,2] + rnorm(1,0,0.1)
}
result<-clustering.sc.dp(x,2)
print(result)

clustering.sc.dp documentation built on Feb. 16, 2023, 10:59 p.m.