1 ## identify.phylo.R (2008-01-14)
3 ## Graphical Identification of Nodes and Tips
5 ## Copyright 2008 Emmanuel Paradis
7 ## This file is part of the R-package `ape'.
8 ## See the file ../COPYING for licensing issues.
10 identify.phylo <- function(x, nodes = TRUE, tips = FALSE,
13 cat("Click close to a node of the tree...\n")
15 Ntip <- .last_plot.phylo$Ntip
16 d <- sqrt((xy$x - .last_plot.phylo$xx)^2 +
17 (xy$y - .last_plot.phylo$yy)^2)
21 res$tips <- if (labels) x$tip.label[NODE] else NODE
25 TIPS <- prop.part(x)[[NODE - Ntip]]
26 res$tips <- if (labels) x$tip.label[TIPS] else TIPS
29 if (is.null(x$node.label)) labels <- FALSE
30 res$nodes <- if (labels) x$node.label[NODE - Ntip] else NODE