colpairs                package:gclus                R Documentation

_A_p_p_l_i_e_s _a _f_u_n_c_t_i_o_n _t_o _a_l_l _p_a_i_r_s _o_f _c_o_l_u_m_n_s

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

     Given an nxp matrix 'm' and a function 'f', returns the pxp matrix
     got by applying 'f'  to all pairs of columns of 'm' .

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

     colpairs(m, f, diag = 0, na.omit = FALSE, ...)

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

       m: a matrix 

       f: a function of two vectors, which returns a single result. 

    diag: if supplied, this value is placed on the diagonal of the
          result. 

 na.omit: If 'TRUE', rows with missing values are omitted for each pair
          of columns. 

     ...: argments are passed to 'f'. 

_V_a_l_u_e:

     a matrix matrix got by applying 'f'  to all pairs of columns of
     'm' .

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

     Catherine B. Hurley

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

     'gave', 'partition.crit',  'order.single','order.endlink'

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

     data(state)
     state.m <- colpairs(state.x77, 
     function(x,y)  cor.test(x,y,"two.sided","kendall")$estimate, diag=1)
     state.col <- dmat.color(state.m)
     # This is equivalent to state.m <- cor(state.x77,method="kendall")

     layout(matrix(1:2,nrow=1,ncol=2))
     cparcoord(state.x77, panel.color= state.col)
     # Get rid of the panels with lots of line crossings (yellow) by reorderings
     cparcoord(state.x77, order.endlink(state.m), state.col)
     layout(matrix(1,1))

     # m is a homogeneity measure of each pairwise variable plot
     m <- -colpairs(scale(state.x77), gave)

     o<- order.single(m)
     pcols = dmat.color(m)
     # Color panels by level of m and reorder variables so that
     # pairs with high m are near the diagonal.
     cpairs(state.x77,order=o, panel.colors=pcols)

     # In this case panels showing either of Area or Population
     # exhibit the most clumpiness because these variables
     # are skewed.

