-## write.tree.R (2009-03-23)
+## write.tree.R (2009-05-10)
## Write Tree File in Parenthetic Format
}
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)
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)
}
}
n <- length(phy$tip.label)
- if(tree.names){STRING <- paste(tname,"(",sep="")
- }else STRING <- "("
+ STRING <-
+ if (output.tree.names) paste(tree.names, "(", sep = "") else "("
br <- which(phy$edge[, 1] == n + 1)
for (j in br) {
desc <- phy$edge[j, 2]