xgvis {xgobi} | R Documentation |
R interface to XGvis
, an interactive multidimensional scaling
(MDS) program that consists of a control panel to manipulate the
parameters of the MDS stress function and an xgobi
window for data display. It can be used either for visualization of
dissimilarity data, for dimension reduction, or for graph layout.
Graph layout is usually done in 2D, but xgvis
allows layouts in
arbitrary dimensions, 3D being the default. It permits missing
values, which can be used to implement multidimensional unfolding.
xgvis(dmat = NULL, edges= NULL, pos = NULL, rowlab = dimnames(dmat)[[1]], colors = NULL, glyphs = NULL, erase = NULL, lines = NULL, linecolors = NULL, resources = NULL, display = NULL, keep = FALSE, fprefix = "xgvis-") )
dmat |
numeric n * n distance matrix. |
edges |
n * 2 or n * 3 matrix of
specifications for the pattern of line segments which
connect pairs of points. Must contain at least two numbers per
line. The first two numbers represent the row numbers of the two
points that should be connected. (This is exactly like the structure
of a the lines argument of xgobi .) In addition,
if a third number is present, it is taken to be an edge weight.
If edges is specified and dmat not, then
the distance matrix is computed from edges , with each
edge representing a distance of one.
|
pos |
Starting positions: an n * p matrix.
If pos is specified and dmat not,
the distance matrix is computed from pos . |
rowlab |
character vector of n row labels (defaulting to those of
dmat ); if no default exists, xgobi constructs
its own (numbers 1:n ). |
colors |
optional character vector supplying initial point colors
to be used; see xgobi . |
glyphs |
integer vector, used to supply glyphs to be used on
startup, see xgobi . |
The UNIX status
upon completion, i.e. 0
if ok.
The xgvis R function executes a call to the C program of the same name, and returns control of the R command line to the user.
D. F. Swayne dfs@research.att.com
of R port: Kurt Hornik and Martin Maechler maechler@stat.math.ethz.ch
http://www.research.att.com/areas/stat/xgobi/,
http://www.public.iastate.edu/~dicook/
data(morsecodes) ## from the XGobi/XGvis data, see ?morsecodes mc.row <- paste(morsecodes.row[,1],morsecodes.row[,2]) xgvis(dmat = morsecodes.dist, pos = morsecodes.pos, rowlab = mc.row, colors = morsecodes.colors, glyphs = morsecodes.glyphs, lines = morsecodes.lines, linecolors = morsecodes.linecolors) ##> 2) Show lines by hitting "l" with the mouse over the plot. ##> 3) Examine morsecode labels by hitting "i" and mousing around on the plot. ##> 3b) Press "r" (on the plot) to switch 3D rotation in xgobi. ##> 4) Run MDS in 3D by clicking "Run MDS" (in xgvis). ##> 5) Speed up the optimization by increasing the "Stepsize" with the slider. ##> The "Stress function" value may go as low as 0.1925 (MM). ##> 6) When the optimization calms down, click "Run MDS" to toggle MDS off. ##> 7) Rotate the MDS configuration in 3D {by "r" with mouse over plot}. ##> 8) Increase the rotation speed with the slider in the top left and ##> control the rotation direction by dragging the mouse on the plot. ##> 9) You can check out the initial configuration by ## In order to have no color warning : Mcolors <- unique(morsecodes.colors) (Mcolors <- paste("*brushColor", 0:(length(Mcolors)-1),": ", Mcolors, sep="")) xgobi(morsecodes.pos, collab = morsecodes.col, rowlab = mc.row, colors = morsecodes.colors, glyphs = morsecodes.glyphs, lines = morsecodes.lines, linecolors = morsecodes.linecolors, resources= c("*showLines: True", Mcolors)) ##> This XGobi window will be linked with ##> the XGvis window for glyph-color brushing and labeling.