Returns a sorted data matrix
Sort the rows and columns of a matrix in a "magic" order or by ascending (or descending) mean or median or geometrical mean.
magicsort(matrice, sort.mat = matrice, method = "magic", byrow = TRUE, bycol = TRUE, ascending = TRUE)
matrice
: a data matrix to sortsort.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 rowsbycol
: boolean, if TRUE then data are sorted over the columnsascending
: boolean, if TRUE then data are sorted in ascending orderVery useful function to compare results.
F Husson, S Le
## 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")