magicsort             package:SensoMineR             R Documentation

_R_e_t_u_r_n_s _a _s_o_r_t_e_d _d_a_t_a _m_a_t_r_i_x

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

     Sort the rows and columns of a matrix in a "magic" order or by
     ascending (or descending) mean or median or geometrical mean.

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

     magicsort(matrice, sort.mat = matrice, method = "magic",
         byrow = TRUE, bycol = TRUE, ascending = TRUE)

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

 matrice: a data matrix to sort

sort.mat: sort the rows and columns according to the result of the PCA
          made on this matrix (by default the 'matrice')

  method: four types of calculations, magic ('"magic"'), ('"median"'),
          arithmetical ('"mean"') or geometrical ('"geo"') mean (by
          default magic)

   byrow: boolean, if TRUE then data are sorted over the rows

   bycol: boolean, if TRUE then data are sorted over the columns

ascending: boolean, if TRUE then data are sorted in ascending order

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

     Very useful function to compare results.

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

     Franois Husson, Sbastien L

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

     ## Example 1
     data(chocolates)
     resdecat<-decat(sensochoc, formul = "~Product", firstvar = 5, 
         graph = FALSE)
     coltable(magicsort(resdecat$tabT), level.lower = -1.96, 
         level.upper = 1.96, main.title = "Products' description")

     ## Example 2
     data(chocolates)
     resperf<-paneliperf(sensochoc, 
         formul = "~Product+Panelist+Product:Panelist",
         formul.j = "~Product", col.j = 1, firstvar = 5, lastvar = 12,
         synthesis = FALSE, graph = FALSE)
     res.sort=magicsort(resperf$prob.ind, method = "median")
     coltable(res.sort, main.title = "P-values of the F-test by panelist")

