Description Usage Arguments Author(s) References See Also Examples
This function draws a scatterplot matrix of data. Variables may be reordered and panels colored in the display.
1 2 |
data |
a numeric matrix |
order |
the order of variables. Default is the order in data. |
panel.colors |
a matrix of panel colors. If supplied, dimensions should match those of the pairs plot. Diagonal entries are ignored. |
border.color |
used for panel border. |
show.points |
If FALSE, no points are drawn. |
... |
graphical parameters passed to |
Catherine B. Hurley
Hurley, Catherine B. “Clustering Visualisations of Multidimensional Data”, to appear in JCGS.
pairs
, cparcoord
,
dmat.color
,colpairs
, order.single
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | data(USJudgeRatings)
judge.cor <- cor(USJudgeRatings)
judge.color <- dmat.color(judge.cor)
# Colors variables by their correlation.
cpairs(USJudgeRatings,panel.colors=judge.color,pch=".",gap=.5)
judge.o <- order.single(judge.cor)
# Reorder variables so that those with highest correlation
# are close to the diagonal.
cpairs(USJudgeRatings,judge.o,judge.color,pch=".",gap=.5)
# Specify your own color scheme
judge.color <- dmat.color(judge.cor, breaks=c(-1,0,.5,.9,1), colors =
cm.colors(4))
data(bank)
# m is a homogeneity measure of each pairwise variable plot
m <- -colpairs(scale(bank[,-1]), partition.crit,gfun=gave,groups=bank[,1])
# Color panels by level of m and reorder variables so that
# pairs with high m are near the diagonal. Panels shown
# in pink have the highest amount of group homogeneity, as measured by
# gave.
cpairs(bank[,-1],order=order.single(m), panel.colors=dmat.color(m),
gap=.3,col=c("purple","black")[bank[,"Status"]+1],
pch=c(5,3)[bank[,"Status"]+1])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.