order.dist(x, index = FALSE)
order.matrix(x, type = "neumann", by = c("both","rows","cols"),
index = FALSE)
order.data.frame(x, type = "neumann", by = c("both","rows","cols"),
index = FALSE)
dist
, matrix
, or
data.frame
.reorder.dist
), or a list with components rows
and
columns
containing the order indexes (for reorder.matrix
and reorder.data.frame
).dist
, matrix
, or
data.frame
by reordering the rows
and columns such that similar entries are grouped together. order.dist
uses a simple heuristic to solve the TSP problem of
finding an ordering of minimum length (see order.length
) for an
object of class dist
. Note that the heuristic used is quick but
more elaborate TSP algorithms will produce better orderings.
order.matrix
tries to minimize the stress measure of a matrix
(see stress
by using the same TSP heuristic as above, once for
the column and once for the row ordering (while the other dimension is
fixed) if by = "both"
.
order.data.frame
uses attributes of type numeric
and logical
only, combines them into a normalized matrix and
finds an ordering as above.
dist
, stress
, stress.dist
.## not a hard problem
data(iris)
d <- dist(iris[1:4])
image(order.dist(d))
data(townships)
x <- order.data.frame(townships)
x
Run the code above in your browser using DataLab