.BG
.FN mstree
.TL
Minimal Spanning Tree and Multivariate Planing
.CS
mstree(x, plane=TRUE)
.AG x
matrix of data where rows correspond to observations,
columns to variables.  Should be scaled so that values on
all variables are roughly comparable (the algorithm computes
Euclidean distances from one observation to another).
.AG plane
logical, should multivariate planing and lining information be
returned?  If `TRUE', all components listed below
are returned; if `FALSE', only the minimum spanning tree `mst'
is returned.
.RT
list with components named `x', `y', `mst', and `order',
describing the planing, minimal spanning tree, and two
versions of lining.  If `plane' is `FALSE',
only the `mst' vector is returned.
.RC x,y
coordinates of the observations computed by the Friedman-Rafsky algorithm.
.SP
.RC mst
vector of length `nrow(x)\-1' describing the edges in the
minimal spanning tree.  The `i'th value in this vector is an
observation number, indicating that this observation and the
`i'th observation should be linked in the minimal spanning
tree.
.RC order
matrix, `nrow(x)' by 2, giving two types of ordering: The
first column presents the standard ordering from one extreme
of the MST to the other.  The second column presents the
radial ordering, based on distance from the center of the
MST.
.SH REFERENCE
J. H. Friedman and L. C. Rafsky,
"Graphics for the Multivariate Two-Sample Problem",
.ul
J. Amer. Stat. Assoc.,
Vol. 76 (1981), pp. 277-287.
.EX
plot(x,y)   # plot original data
mst <- mstree(cbind(x,y),plane=F)   # minimal spanning tree 
   # show tree on plot
segments(x[seq(mst)],y[seq(mst)],x[mst],y[mst]) 

i <- rbind(iris[,,1],iris[,,2],iris[,,3])
tree <- mstree(i)    # multivariate planing
plot(tree,type="n")  # plot data in plane
text(tree)           # identify points
.KW array
.KW multivariate
.KW dplot
.WR
