October 2017
Beginner to intermediate
572 pages
26h 1m
English
Besides using dissplot to visualize the dissimilarity matrix, one can also visualize a distance matrix by using the dist and image functions. In the resulting graph, closely related entries are plotted in red. Less related entries are plotted closer to white:
> image(as.matrix(dist(customer)))

In order to plot both a dendrogram and heat map to show how data is clustered, you can use the heatmap function:
> cd=dist(customer) > hc=hclust(cd) > cdt=dist(t(customer)) > hcc=hclust(cdt) > heatmap(customer, Rowv=as.dendrogram(hc), Colv=as.dendrogram(hcc))
Read now
Unlock full access