varOrder {candisc}  R Documentation 
The varOrder
function implements some features of “effect ordering”
(Friendly & Kwan (2003)
for variables in a multivariate data display to make the
displayed relationships more coherent.
This can be used in pairwise HE plots, scatterplot matrices, parallel coordinate plots, plots of multivariate means, and so forth.
For a numeric data frame, the most useful displays often order variables according to the angles of variable vectors in a 2D principal component analysis or biplot. For a multivariate linear model, the analog is to use the angles of the variable vectors in a 2D canonical discriminant biplot.
varOrder(x, ...) ## S3 method for class 'mlm' varOrder(x, term, variables, type = c("can", "pc"), method = c("angles", "dim1", "dim2", "alphabet", "data", "colmean"), names = FALSE, descending = FALSE, ...) ## S3 method for class 'data.frame' varOrder(x, variables, method = c("angles", "dim1", "dim2", "alphabet", "data", "colmean"), names = FALSE, descending = FALSE, ...)
x 
A multivariate linear model or a numeric data frame 
term 
For the 
variables 
indices or names of the variables to be ordered; defaults to all response variables an MLM or all numeric variables in a data frame. 
type 
For an MLM, 
method 
One of

names 
logical; if 
descending 
If 
... 
Arguments passed to methods 
A vector of integer indices of the variables or a character vector of their names.
Michael Friendly
Friendly, M. & Kwan, E. (2003). Effect Ordering for Data Displays, Computational Statistics and Data Analysis, 43, 509539. doi: 10.1016/S01679473(02)002906
data(Wine, package="candisc") Wine.mod < lm(as.matrix(Wine[, 1]) ~ Cultivar, data=Wine) Wine.can < candisc(Wine.mod) plot(Wine.can, ellipse=TRUE) # pairs.mlm HE plot, variables in given order pairs(Wine.mod, fill=TRUE, fill.alpha=.1, var.cex=1.5) order < varOrder(Wine.mod) pairs(Wine.mod, variables=order, fill=TRUE, fill.alpha=.1, var.cex=1.5)