# sample data
data(data20)
# creating an object with results of hierarchical clustering of
hca.object <- nomclust(data20, measure = "lin", method = "average",
clu.high = 5, prox = TRUE)
# assigning variable weights
hca.weights <- nomclust(data20, measure = "lin", method = "average",
clu.high = 5, prox = TRUE, var.weights = c(0.7, 1, 0.9, 0.5, 0))
# quick clustering summary
summary(hca.object)
# quick cluster quality evaluation
print(hca.object)
# visualization of the evaluation criteria
eval.plot(hca.object)
# a quick dendrogram
plot(hca.object)
# a dendrogram with three designated clusters
dend.plot(hca.object, clusters = 3)
# obtaining values of evaluation indices as a data.frame
data20.eval <- as.data.frame(hca.object$eval)
# getting the optimal numbers of clusters as a data.frame
data20.opt <- as.data.frame(hca.object$opt)
# extracting cluster membership variables as a data.frame
data20.mem <- as.data.frame(hca.object$mem)
# obtaining a proximity matrix
data20.prox <- as.matrix(hca.object$prox)
# setting the maximal number of objects for which a proximity matrix is provided in the output to 30
hca.object <- nomclust(data20, measure = "iof", method = "complete",
clu.high = 5, prox = 30)
# transforming the nomclust object to the class "hclust"
hca.object.hclust <- as.hclust(hca.object)
# transforming the nomclust object to the class "agnes, twins"
hca.object.agnes <- as.agnes(hca.object)
Run the code above in your browser using DataLab