Description Usage Arguments Value Side Effects CONTACT Author(s) References See Also Examples
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.
1 2 3 4 5 6 7 8 9 |
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 If |
pos |
Starting positions: an |
rowlab |
character vector of |
colors |
optional character vector supplying initial point colors
to be used; see |
glyphs |
integer vector, used to supply glyphs to be used on
startup, see |
erase |
Optional integer vector of length equal to the number of rows in the data and composed of 1s and 0s. A 1 in position i specifies that point i should be erased. The default is a vector of 0s. |
lines |
Optional integer matrix, n by 2, which specifies by row number
pairs of points to be connected by line segments.
If |
linecolors |
Optional integer vector, of length n where n is the number of
lines specified by the |
resources |
Optional character vector created by clicking on the “Save Resources” button in XGobi. |
display |
Optional character string, identifying the monitor on which to display
the xgvis window. The default is |
multi |
logical, indicating if the |
keep |
logical, indicating if the temporary files should be kept
(e.g. for calling the |
fprefix |
character string for the file name prefix to be used for temporary files. |
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/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | 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.
|
xgvis /work/tmp/tmp/RtmpisIjI4/xgvis-30ec21cc6fc7 &
sh: 0: Can't open /dev/null
[1] "*brushColor0: SkyBlue" "*brushColor1: Green" "*brushColor2: Yellow"
[4] "*brushColor3: HotPink" "*brushColor4: Red"
xgobi -title 'morsecodes.pos' -std mmx /work/tmp/tmp/RtmpisIjI4/xgobi-mrscd30ec3d54540d &
sh: 0: Can't open /dev/null
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.