]> git.donarmstrong.com Git - ape.git/blobdiff - R/write.tree.R
improved ace()
[ape.git] / R / write.tree.R
index 058565c1364fbe4c1437620e0f4740ae9ef934b1..1669e535ae66f1f937b3e53017c98ae4382a3d42 100644 (file)
@@ -1,4 +1,4 @@
-## write.tree.R (2009-03-23)
+## write.tree.R (2009-05-10)
 
 ##   Write Tree File in Parenthetic Format
 
@@ -39,7 +39,7 @@ write.tree <-
     }
     if (output.tree.names)
         names(tree) <- checkLabel(names(tree))
-    if (class(phy) == "multiPhylo") {
+    if (inherits(phy, "multiPhylo")) {
         write.tree(phy[[1]], file = file, append = append,
                    digits = digits, tree.names = names[1])
         if (length(phy) > 1)
@@ -47,7 +47,7 @@ write.tree <-
                 append = TRUE, digits = digits, tree.names = names(phy)[i])
         return(invisible(NULL))
     }
-    if (class(phy) != "phylo")
+    if (!inherits(phy, "phylo"))
         stop("object \"phy\" is not of class \"phylo\"")
     brl <- !is.null(phy$edge.length)
     nodelab <- !is.null(phy$node.label)