cparcoord {gclus} | R Documentation |
Enhanced parallel coordinate plot
Description
This function draws a parallel coordinate plot of data. Variables
may be reordered and panels colored in the display. It is a modified
version of parcoord {MASS}
.
Usage
cparcoord(data, order = NULL, panel.colors = NULL, col = 1, lty = 1,
horizontal = FALSE, mar = NULL, ...)
Arguments
data |
a numeric matrix |
order |
the order of variables. Default is the order in data. |
panel.colors |
either a vector or a matrix of panel colors. If a vector is supplied, the ith color is used for the ith panel. If a matrix, dimensions should match those of the variables. Diagonal entries are ignored. |
col |
a vector of colours, recycled as necessary for each observation. |
lty |
a vector of line types, recycled as necessary for each observation. |
horizontal |
If TRUE, orientation is horizontal. |
mar |
margin parameters, passed to |
... |
graphics parameters which are passed to matplot. |
Details
If panel.colors
is a matrix and order
is supplied, panel.colors
is
reordered.
Author(s)
Catherine B. Hurley
References
Hurley, Catherine B. “Clustering Visualisations of Multidimensional Data”, Journal of Computational and Graphical Statistics, vol. 13, (4), pp 788-806, 2004.
See Also
cpairs
, parcoord
,
dmat.color
, colpairs
, order.endlink
.
Examples
data(state)
state.m <- colpairs(state.x77,
function(x,y) cor.test(x,y,"two.sided","kendall")$estimate, diag=1)
# OR, Works only in R1.8, state.m <-cor(state.x77,method="kendall")
state.col <- dmat.color(state.m)
cparcoord(state.x77, panel.color= state.col)
# Get rid of the panels with lots of line crossings (yellow) by reordering:
cparcoord(state.x77, order.endlink(state.m), state.col)
# To get rid of the panels with lots of long line segments:
# use a different panel merit measure- pclen:
mins <- apply(state.x77,2,min)
ranges <- apply(state.x77,2,max) - mins
state.m <- -colpairs(scale(state.x77,mins,ranges), pclen)
cparcoord(state.x77, order.endlink(state.m), dmat.color(state.m))