#example 1: no groups in data
#random generation of group labels
set.seed(54321)
x <- rnorm(50)
groups <- sample(1:2, 50, replace=TRUE)
groups
dsil <- dbs(x=as.matrix(x), clusters=groups)
dsil
summary(dsil)
plot(dsil, labels=TRUE, lwd=6)
#example 2: wines data
# load data
data(wine)
gr <- wine[,1]
# select a subset of variables
x <- wine[, c(2,5,8)]
#clustering
cl <- pdfCluster(x)
dsil <- dbs(cl)
plot(dsil)
Run the code above in your browser using DataLab