-## write.tree.R (2010-11-08)
+## write.tree.R (2010-12-07)
## Write Tree File in Parenthetic Format
write.tree <-
function(phy, file = "", append = FALSE, digits = 10, tree.names = FALSE)
{
- if (!(inherits(phy, "phylo") || inherits(phy, "multiPhylo")))
+ if (!(inherits(phy, c("phylo", "multiPhylo"))))
stop("object \"phy\" has no trees")
if (inherits(phy, "phylo")) phy <- c(phy)
if (j != desc[length(desc)]) cp(",")
}
cp(")")
- if (nodelab && ind[i] > n) cp(phy$node.label[ind[i] - n])
+ if (nodelab && i > n) cp(phy$node.label[i - n]) # fixed by Naim Matasci (2010-12-07)
if (brl) {
cp(":")
cp(sprintf(f.d, phy$edge.length[ind[i]]))