cpairs                 package:gclus                 R Documentation

_E_n_h_a_n_c_e_d _s_c_a_t_t_e_r_p_l_o_t _m_a_t_r_i_x

_D_e_s_c_r_i_p_t_i_o_n:

     This function draws a scatterplot matrix of data. Variables may be
     reordered and panels colored in the display.

_U_s_a_g_e:

     cpairs(data, order = NULL, panel.colors = NULL, border.color = "grey70", show.points = TRUE, ...)

_A_r_g_u_m_e_n_t_s:

    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 'pairs.default'. 

_A_u_t_h_o_r(_s):

     Catherine B. Hurley

_R_e_f_e_r_e_n_c_e_s:

     Hurley, Catherine B.  ``Clustering Visualisations of
     Multidimensional  Data'', to appear in JCGS.

_S_e_e _A_l_s_o:

     'pairs', 'cparcoord',  'dmat.color','colpairs', 'order.single'.

_E_x_a_m_p_l_e_s:

     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])

