Description Usage Arguments Value Note See Also Examples
Reads the position of the graphics pointer when the left mouse button is pressed. It then cuts the tree at the vertical position of the pointer and draws a colored rectangle (rec.col) around the cluster containing the horizontal position of the pointer, and identifies the objects in the corresponding cluster. This can be repeated up to a maximum of N times. Each press of the left mouse button selects a (different) cluster. The new cluster is colored rec.col and the color of the previous one is changed to old.col. When finished, pressing the right mouse button and selecting 'stop' returns control to the command window.
1 | getclust(hc, ngr = 20, rec.col = "blue", old.col = "blue")
|
hc |
an object of the type produced by |
ngr |
maximum number of clusters that can be selected |
rec.col |
color of the most recently selected cluster |
old.col |
color of the previously selected clusters. |
(Invisibly) returns a list where each element contains a vector of object identities contained in the respectively selected clusters.
Make sure you have opened a plot device of your dendrogram already! The vector of object identities for each selected cluster are contained in group[[1]]
, group[[2]]
, ...
, group[[NrG]]
in order of selection, where NrG
is the number of selected groups (clicks of the left mouse button). Press Esc or click the right mouse button to end the selection procedure.
1 2 | # need to have an object hc produced by hierclust() or hclust()
# groups <- getclust(hc, NrG= 3)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.