]> git.donarmstrong.com Git - ape.git/blob - man/identify.phylo.Rd
new trex() + kronoviz() and bug fixing in identify.phylo()
[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, quiet = 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{quiet}{a logical controlling whether to print a message inviting
16     the user to click on the tree.}
17   \item{\dots}{further arguments to be passed to or from other methods.}
18 }
19 \description{
20   This function allows to identify a clade on a plotted tree by clicking
21   on the plot with the mouse. The tree, specified in the argument
22   \code{x}, must be plotted beforehand.
23 }
24 \details{
25   By default, the clade is identified by its number as found in the
26   `edge' matrix of the tree. If \code{tips = TRUE}, the tips descending
27   from the identified node are returned, possibly together with the
28   node. If \code{labels = TRUE}, the labels are returned (if the tree
29   has no node labels, then the node numbered is returned).
30
31   The node is identified by the shortest distance where the click
32   occurs. If the click occurs close to a tip, the function returns its
33   information.
34 }
35 \note{
36   This function does not add anything on the plot, but it can be wrapped
37   with, e.g., \code{\link{nodelabels}} (see example), or its results can
38   be sent to, e.g., \code{\link{drop.tip}}.
39 }
40 \value{
41   A list with one or two vectors named \code{"tips"} and/or
42   \code{"nodes"} with the identification of the tips and/or of the
43   nodes.
44 }
45 \author{Emmanuel Paradis}
46 \seealso{
47   \code{\link{plot.phylo}}, \code{\link{nodelabels}},
48   \code{\link[graphics]{identify}} for the generic function
49 }
50 \examples{
51 \dontrun{
52 tr <- rtree(20)
53 f <- function(col) {
54     o <- identify(tr)
55     nodelabels(node=o$nodes, pch = 19, col = col)
56 }
57 plot(tr)
58 f("red") # click close to a node
59 f("green")
60 }
61 }
62 \keyword{aplot}