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

