c2compnames              package:BSagri              R Documentation

_D_e_f_i_n_e _r_o_w _n_a_m_e_s _o_f _a _c_o_n_t_r_a_s_t _m_a_t_r_i_x, _d_e_p_e_n_d_i_n_g _o_n _i_t_s _c_o_l_u_m_n _n_a_m_e_s

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

     Define row names of a contrast matrix, depending on its column
     names, as can be necessary for contrasts matrices. Currently, two
     options to do that are available.

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

     c2compnames(cmat, ntype = "aggr")

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

    cmat: a contrast matrix 

   ntype: a single character string, defining how to build names from
          the column names of 'cmat', currently onls '"aggr"'
          (aggregates names of groups with negative and positive
          coefficients), and '"sequ"' 

_D_e_t_a_i_l_s:

     Improvements of this function are welcome!

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

     The input matrix cmat, with its row names replaced.

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

     'contrMat' in 'multcomp' to define contrast matrices of different
     types

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

     # names for interaction contrasts:

     n1<-c(10,10,10,10)
     names(n1)<-c("A","B","C","D")

     n2<-c(3,3,3)
     names(n2)<-c(1,2,3)

     library(multcomp)

     CMT1<-contrMat(n1, type="Tukey")

     CMT2<-contrMat(n2, type="Tukey")

     IAC<-IAcontrastsCMAT(CMAT1=CMT1, CMAT2=CMT2)

     c2compnames(IAC, ntype="aggr")

     c2compnames(IAC, ntype="sequ")

     ###############################

     # names for Williams-type contrasts:

     n1<-c(10,10,10,10)
     names(n1)<-c("C0","D1","D5","D10")

     CMW<-contrMat(n1, type="Williams")

     CMW

     c2compnames(CMW, ntype="aggr")

     c2compnames(CMW, ntype="sequ")

