X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=R%2Fidentify.phylo.R;h=62476db1c437f5880e4b0ab631aa37724828a696;hb=d88302b4735b5b7c9132387090bb592d906fe1cb;hp=46ab427458398c59afd37ccaf53c5852930986ac;hpb=2e3b8be33765d5311e071efb39871249d16f7e30;p=ape.git diff --git a/R/identify.phylo.R b/R/identify.phylo.R index 46ab427..62476db 100644 --- a/R/identify.phylo.R +++ b/R/identify.phylo.R @@ -1,8 +1,8 @@ -## identify.phylo.R (2007-12-14) +## identify.phylo.R (2008-01-14) ## Graphical Identification of Nodes and Tips -## Copyright 2007 Emmanuel Paradis +## Copyright 2008 Emmanuel Paradis ## This file is part of the R-package `ape'. ## See the file ../COPYING for licensing issues. @@ -10,12 +10,12 @@ identify.phylo <- function(x, nodes = TRUE, tips = FALSE, labels = FALSE, ...) { + cat("Click close to a node of the tree...\n") xy <- locator(1) Ntip <- .last_plot.phylo$Ntip d <- sqrt((xy$x - .last_plot.phylo$xx)^2 + (xy$y - .last_plot.phylo$yy)^2) NODE <- which.min(d) - print(NODE) res <- list() if (NODE <= Ntip) { res$tips <- if (labels) x$tip.label[NODE] else NODE