oclust: Hierarchically cluster ordered data.

Description Usage Arguments Details Value Examples

View source: R/slanter.R

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

1
oclust(distances, method = "ward.D2", order = NULL, members = NULL)

Arguments

distances

A distances object (as created by stats::dist).

method

The clustering method to use (only ward.D and ward.D2 are supported).

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

1
2
clusters <- slanter::oclust(dist(mtcars), order=1:dim(mtcars)[1])
clusters$order

slanter documentation built on May 9, 2021, 9:07 a.m.