]> git.donarmstrong.com Git - ape.git/blobdiff - R/rotate.R
final commit for ape 3.0-8
[ape.git] / R / rotate.R
index 520d677d8d96369cdc8ba953d6fd432f62757018..2ea848082fedd8228da92fffb7ffbb217a6a8b44 100644 (file)
@@ -1,5 +1,5 @@
 ### ROTATE
-### Last update CH on 09.08.2007
+### Last update CH on 09.08.2007 (updated by EP 2011-06-14)
 
 # Contents:
 # 1. rotate
@@ -28,7 +28,7 @@ rotate <- function(phy, node, polytom = c(1,2)){
                }
 # function starts here 
 # definitions
-       if (class(phy) != "phylo") # is phy of class phylo?
+       if (!inherits(phy, "phylo")) # is phy of class phylo?
         stop("object \"phy\" is not of class \"phylo\"")
     nb.tips <- length(phy$tip.label) # number of tiplabels
        max.int.node <- phy$Nnode+nb.tips # number of last internal node
@@ -119,7 +119,8 @@ else {
                        phy$edge.length <- c(phy$edge.length[c3:c4], phy$edge.length[(c2+1):(c3-1)], phy$edge.length[c1:c2])
                }
        }
-       S <- write.tree(phy)
-    phy <- if (!with.br.length) clado.build(S) else tree.build(S)
+        ## deleted by EP (2011-06-14):
+       ## S <- write.tree(phy)
+        ## phy <- if (!with.br.length) clado.build(S) else tree.build(S)
        phy
        }