data(DataQuan) # set of quantitative data
data <- DataQuan[,2:8]
rownames(data) <- DataQuan[1:nrow(DataQuan),1]
res <- Cluster(data, titles = NA, hierarquic = TRUE, analysis = "Obs",
cor.abs = FALSE, normalize = FALSE, distance = "euclidean",
method = "ward.D", horizontal = FALSE, num.groups = 2,
savptc = FALSE, width = 3236, height = 2000, res = 300,
casc = FALSE)
print("R squared:"); res$R.sqt
# print("Total sum of squares:"); res$sum.sqt
print("Groups formed:"); res$groups
# print("Table with similarities and distances:"); res$tab.res
# print("Table with the results of the groups:"); res$res.groups
# print("Distance Matrix:"); res$mtx.dist
write.table(file=file.path(tempdir(),"SimilarityTable.csv"), res$tab.res, sep=";",
dec=",",row.names = FALSE)
write.table(file=file.path(tempdir(),"GroupData.csv"), res$groups, sep=";",
dec=",",row.names = TRUE)
write.table(file=file.path(tempdir(),"GroupResults.csv"), res$res.groups, sep=";",
dec=",",row.names = TRUE)
Run the code above in your browser using DataLab