Learn R Programming

clustering.sc.dp (version 1.0)

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

Description

Print the result returned by calling clustering.sc.dp

Usage

"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.

Examples

Run this code
# 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)

Run the code above in your browser using DataLab