Description Usage Arguments Value Examples
reorder rows of treeMatrix attribute of clusterTree so that data points that belong to the same cluster are always next to each other. This will help us process the plot function
1 | reOrderClusterTreeMatrix(treeMatrix, order = NULL)
|
treeMatrix |
is the treeMatrix attribute of clusterTree object |
order |
order is the inital order of rows of x, default is c(1:n) |
an order which data points belong to same cluster are always next to each other
1 2 3 4 5 6 7 8 9 10 11 12 | data <- iris[,1:4]
clustering1 <- stats::hclust(dist(data),method='single')
clustering2 <- kmeans(data,centers=3)
clustering3 <- dbscan::dbscan(data,eps=.78)
res <- combineClusterings(clustering1,clustering2,clustering3)
# obtain the order for reordering cluster tree
order <- reorderClusterTreeMatrix(res$treeMatrix)
# After reordering, data points with same cluster id are always next
# to each other
reordered_treeMatrix <- res$treeMatrix[order,]
# check reordered_treeMatrix
reordered_treeMatrix
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.