]> git.donarmstrong.com Git - ape.git/blob - man/identify.phylo.Rd
various corrections
[ape.git] / man / identify.phylo.Rd
1 \name{identify.phylo}
2 \alias{identify.phylo}
3 \title{Graphical Identification of Nodes and Tips}
4 \usage{
5 \method{identify}{phylo}(x, nodes = TRUE, tips = FALSE,
6                   labels = FALSE, ...)
7 }
8 \arguments{
9   \item{x}{an object of class \code{"phylo"}.}
10   \item{nodes}{a logical specifying whether to identify the node.}
11   \item{tips}{a logical specifying whether to return the tip
12     information.}
13   \item{labels}{a logical specifying whether to return the labels; by
14     default only the numbers are returned.}
15   \item{\dots}{further arguments to be passed to or from other methods.}
16 }
17 \description{
18   This function allows to identify a clade on a plotted tree by clicking
19   on the plot with the mouse. The tree, specified in the argument
20   \code{x}, must be plotted beforehand.
21 }
22 \details{
23   By default, the clade is identified by its number as found in the
24   `edge' matrix of the tree. If \code{tips = TRUE}, the tips descending
25   from the identified node are returned, possibly together with the
26   node. If \code{labels = TRUE}, the labels are returned (if the tree
27   has no node labels, then the node numbered is returned).
28
29   The node is identified by the shortest distance where the click
30   occurs. If the click occurs close to a tip, the function returns its
31   information.
32 }
33 \note{
34   This function does not add anything on the plot, but it can be wrapped
35   with, e.g., \code{\link{nodelabels}} (see example), or its results can
36   be sent to, e.g., \code{\link{drop.tip}}.
37 }
38 \value{
39   A list with one or two vectors named \code{"tips"} and/or
40   \code{"nodes"} with the identification of the tips and/or of the
41   nodes.
42 }
43 \author{Emmanuel Paradis}
44 \seealso{
45   \code{\link{plot.phylo}}, \code{\link{nodelabels}},
46   \code{\link[graphics]{identify}} for the generic function
47 }
48 \examples{
49 \dontrun{
50 tr <- rtree(20)
51 f <- function(col) {
52     o <- identify(tr)
53     nodelabels(node=o$nodes, pch = 19, col = col)
54 }
55 plot(tr)
56 f("red") # click close to a node
57 f("green")
58 }
59 }
60 \keyword{aplot}