endpoints            package:ComPairWise            R Documentation

_F_i_n_d _t_h_e _b_r_e_a_k_p_o_i_n_t_s _b_e_t_w_e_e_n _i_d_e_n_t_i_c_a_l _a_n_d _d_i_f_f_e_r_e_n_t _a_l_i_g_n_m_e_n_t _c_o_l_u_m_n_s

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

     Finds identical columns followed by different columns, and
     different columns followed by identical columns.  Internal
     function to find breakpoints for annotating axes.

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

     endpoints(ident.set, diff.set)

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

ident.set: Numeric indices of identical columns

diff.set: Numeric indices of non-identical columns

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

     A vector of integers.

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

     TER

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

     ##---- Should be DIRECTLY executable !! ----
     ##-- ==>  Define data, use random,
     ##--    or do  help(data=index)  for the standard data sets.

     identical<-c(1:10,12,15:20)
     different<-c(11,13:14,21:25)
     a<-endpoints(identical,different);a     #should return c(10,11,12,14,20)

     ## The function is currently defined as
     function (ident.set, diff.set) 
     {
         end.points <- c()
         len.all <- length(ident.set) + length(diff.set)
         end.points <- which((1:(len.all - 1) %in% ident.set & 2:(len.all) %in% 
             diff.set) | (1:(len.all - 1) %in% diff.set & 2:(len.all) %in% 
             ident.set))
       }

