oclust {slanter} | R Documentation |
Hierarchically cluster ordered data.
Description
Given a distance matrix for sorted objects, compute a hierarchical clustering preserving this
order. That is, this is similar to hclust
with the constraint that the result's order is
always 1:N
.
Usage
oclust(distances, method = "ward.D2", order = NULL, members = NULL)
Arguments
distances |
A distances object (as created by |
method |
The clustering method to use (only |
order |
If specified, assume the data will be re-ordered by this order. |
members |
Optionally, the number of members for each row/column of the distances (by default, one each). |
Details
If an order
is specified, assumes that the data will be re-ordered by this order. That is,
the indices in the returned hclust
object will refer to the post-reorder data locations,
**not** to the current data locations.
This can be applied to the results of slanted_reorder
, to give a "plausible"
clustering for the data.
Value
A clustering object (as created by hclust
).
Examples
clusters <- slanter::oclust(dist(mtcars), order=1:dim(mtcars)[1])
clusters$order