estimateNumPerm          package:sigPathway          R Documentation

_C_o_m_p_u_t_e _t_h_e _N_u_m_b_e_r _o_f _U_n_i_q_u_e _P_e_r_m_u_t_a_t_i_o_n_s _f_o_r _a _P_h_e_n_o_t_y_p_e _V_e_c_t_o_r

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

     Computes the number of unique permutations based on a vector of
     phenotypes and the number of groups.

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

     estimateNumPerm(phenotype, ngroups)

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

phenotype: a numeric (or character if 'ngroups' >= 2) vector indicating
          the phenotype

 ngroups: an integer indicating the number of groups in the phenotype

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

     This function calculates the number of unique permutations based
     on the given phenotype and the number of groups present in the
     phenotype.  This function is used internally in 'sigPathway' and
     attempts to avoid numeric overflow associated with multiplying out
     large factorials.

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

     A numeric with length 1.

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

     Weil Lai

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

     ## One group: continuous observations
     ptype1 <- c(24,25,17,26,25,16,14,17,12,15,19,20)
     print(estimateNumPerm(ptype1, 1))

     ## Two groups
     ptype2 <- c(0,1,1,0,1,0,1)
     print(estimateNumPerm(ptype2, 2))

     ## Three groups
     ptype3a <- c(2,0,1,2,0,1,2,0,0,1,1,2)
     print(estimateNumPerm(ptype3a, 3))

     ptype3b <- c("Banana","Apple","Lemon","Lemon","Lemon",
                  "Apple","Lemon","Banana","Banana")
     print(estimateNumPerm(ptype3b, 3))

