magicsort | R Documentation |
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 sort |
sort.mat |
sort the rows and columns according to the result of the PCA made on this matrix (by default the |
method |
four types of calculations, 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 |
Very 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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.