kdist2ktab               package:ade4               R Documentation

_T_r_a_n_s_f_o_r_m_a_t_i_o_n _o_f _K _d_i_s_t_a_n_c_e _m_a_t_r_i_c_e_s (_o_b_j_e_c_t '_k_d_i_s_t') _i_n_t_o _K _E_u_c_l_i_d_e_a_n _r_e_p_r_e_s_e_n_t_a_t_i_o_n_s (_o_b_j_e_c_t '_k_t_a_b')

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

     The function creates a 'ktab' object with the Euclidean
     representations from a 'kdist' object. Notice that the euclid
     attribute must be TRUE for all elements.

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

     kdist2ktab(kd, scale = TRUE, tol = 1e-07)

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

      kd: an object of class 'kdist' 

   scale: a logical value indicating whether the inertia of Euclidean
          representations are equal to 1 (TRUE) or not (FALSE).  

     tol: a tolerance threshold, an eigenvalue is considered equal to
          zero if 'eig$values' > ('eig$values[1' * tol) 

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

     returns a list of class 'ktab' containing for each distance of
     'kd' the data frame of its Euclidean representation

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

     Daniel Chessel chessel@biomserv.univ-lyon1.fr 
      Anne B Dufour dufour@biomserv.univ-lyon1.fr

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

     data(friday87)
     fri.w <- ktab.data.frame(friday87$fau, friday87$fau.blo, 
         tabnames = friday87$tab.names)
     fri.kd <- lapply(1:10, function(x) dist.binary(fri.w[[x]], 10))
     names(fri.kd) <-  substr(friday87$tab.names, 1, 4)
     fri.kd <- kdist(fri.kd)
     fri.ktab = kdist2ktab(kd = fri.kd)
     fri.sepan = sepan(fri.ktab)
     plot(fri.sepan, csub = 3)

     tapply(fri.sepan$Eig, fri.sepan$TC[,1], sum)
     # the sum of the eigenvalues is constant and equal to 1, for each K tables

     fri.statis <- statis(fri.ktab, scan = FALSE, nf = 2)
     round(fri.statis$RV, dig = 2)

     fri.mfa <- mfa(fri.ktab, scan = FALSE, nf = 2)
     fri.mcoa <- mcoa(fri.ktab, scan = FALSE, nf = 2)

     apply(fri.statis$RV, 1, mean) 
     fri.statis$RV.tabw 
     plot(apply(fri.statis$RV, 1, mean), fri.statis$RV.tabw)
     plot(fri.statis$RV.tabw, fri.statis$RV.tabw)

