Just like identify.hclust: reads the position of the graphics pointer when the (first) mouse button is pressed. It then cuts the tree at the vertical position of the pointer and highlights the cluster containing the horizontal position of the pointer. Optionally a function is applied to the index of data points contained in the cluster.
# S3 method for dendrogram identify( x, FUN = NULL, N = 20, MAXCLUSTER, DEV.FUN = NULL, horiz = FALSE, stop_if_out = FALSE, ... )
This function is based on identify.hclust, with slight modifications to have it work with a dendrogram, as well as adding "horiz"
a dendrogram object.
(optional) function to be applied to the index numbers of the data points in a cluster (see 'Details' below).
the maximum number of clusters to be identified.
the maximum number of clusters that can be produced by a cut (limits the effective vertical range of the pointer).
(optional) integer scalar. If specified, the corresponding graphics device is made active before FUN is applied.
logical (FALSE), indicating if the rectangles should be drawn horizontally or not (for when using plot(dend, horiz = TRUE) ) .
logical (default is FALSE). This default makes the function NOT stop if k of the locator is outside the range (this default is different than the behavior of the identify.hclust function - but it is nicer for the user.).
further arguments to FUN.
(Invisibly) returns a list where each element contains a vector of data points contained in the respective cluster.
By default clusters can be identified using the mouse and an invisible list of indices of the respective data points is returned. If FUN is not NULL, then the index vector of data points is passed to this function as first argument, see the examples below. The active graphics device for FUN can be specified using DEV.FUN. The identification process is terminated by pressing any mouse button other than the first, see also identify.