X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=R%2Fzoom.R;h=b24737612f73048e7594dc09450f587e5306f448;hb=50470fdeb74ae1e235e61ed6acfae81dd51f655c;hp=49deac2b013ed74ae6dc17c8b18c6a59277b56fd;hpb=a3ddfc06dd47c560b3ec5869ac104b0c68441eb1;p=ape.git diff --git a/R/zoom.R b/R/zoom.R index 49deac2..b247376 100644 --- a/R/zoom.R +++ b/R/zoom.R @@ -1,8 +1,8 @@ -## zoom.R (2008-04-16) +## zoom.R (2009-07-27) ## Zoom on a Portion of a Phylogeny -## Copyright 2003-2008 Emmanuel Paradis +## Copyright 2003-2009 Emmanuel Paradis ## This file is part of the R-package `ape'. ## See the file ../COPYING for licensing issues. @@ -14,14 +14,13 @@ zoom <- function(phy, focus, subtree = FALSE, col = rainbow, ...) for (i in 1:n) if (is.character(focus[[i]])) focus[[i]] <- which(phy$tip.label %in% focus[[i]]) # fix by Yan Wong - if (is.function(col)) - if (deparse(substitute(col)) == "grey") - col <- grey(1:n/n) else col <- col(n) - ext <- list() - length(ext) <- n + if (is.function(col)) { + col <- if (deparse(substitute(col)) == "grey") grey(1:n/n) else col(n) + } + ext <- vector("list", n) for (i in 1:n) ext[[i]] <- drop.tip(phy, phy$tip.label[-focus[[i]]], - subtree = subtree) + subtree = subtree, rooted = TRUE) nc <- round(sqrt(n)) + 1 nr <- ceiling(sqrt(n)) M <- matrix(0, nr, nc)