# cutree {stats}

### Description

Cuts a tree, e.g., as resulting from `hclust`

, into several groups either by specifying the desired number(s) of groups or the cut height(s).

### Usage

cutree(tree, k = NULL, h = NULL)

### Arguments

At least one of `k`

or `h`

must be specified, `k`

overrides `h`

if both are given.

### Details

Cutting trees at a given height is only possible for ultrametric trees (with monotone clustering heights).

### Values

`cutree`

returns a vector with group memberships if `k`

or `h`

are scalar, otherwise a matrix with group memberships is returned where each column corresponds to the elements of `k`

or `h`

, respectively (which are also used as column names).

### References

Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) *The New S Language*. Wadsworth & Brooks/Cole.

### See Also

`hclust`

, `dendrogram`

for cutting trees themselves.

### Examples

Documentation reproduced from R 3.0.2. License: GPL-2.