This package will order panels in scatterplot matrices and parallel coordinate displays by some merit index. The package contains various indices of merit, ordering functions, and enhanced versions of pairs and parcoord which color panels according to their merit level. For details on the methods used, consult “Clustering Visualisations of Multidimensional Data”, Journal of Computational and Graphical Statistics, vol. 13, (4), pp 788-806, 2004.
library(gclus)
#> Loading required package: cluster
data(longley)
longley.cor <- cor(longley)
longley.color <- dmat.color(longley.cor)dmat.color assigns three colours to the correlations
according to the correlation magnitude. High correlations are in pink,
the middle third are in blue, and the botom third are in yellow.
If you want to change the colour scheme:
longley.color <- dmat.color(longley.cor, byrank=FALSE)
longley.color <- dmat.color(longley.cor, breaks=c(-1,0,.5,.8,1),
cm.colors(4))The plot is easier to interpret if variables are reorded prior to plotting.
par(mar=c(1,1,1,1))
longley.o <- order.hclust(longley.cor)
longley.color1 <- longley.color[longley.o,longley.o]
plotcolors(longley.color1,dlabels=rownames(longley.color1))cpairs is a version of pairs All the
high-correlation panels appear together in a block.
If the order is not supplied, then the variables are
plotted in default dataset order.
cparcoord is a versions of parcoord` where
panels can be coloured. Again, the pink panels have high correlation,
blue panels have middling correlation, and yellow panels have low
correlation.