X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=R%2Fwrite.nexus.R;h=00fcffc9f481614952d2bf8c5cf015bc819f7eba;hb=bfd7604547c1dd38cd97707c184bebf3525cf426;hp=fd4407832b4c6ca2ddb12e78cc5a91b53466b7ab;hpb=48681c35f7904c17b064de9c6bf96d84581e9e52;p=ape.git diff --git a/R/write.nexus.R b/R/write.nexus.R index fd44078..00fcffc 100644 --- a/R/write.nexus.R +++ b/R/write.nexus.R @@ -1,4 +1,4 @@ -## write.nexus.R (2012-02-09) +## write.nexus.R (2012-03-02) ## Write Tree File in Nexus Format @@ -67,9 +67,8 @@ write.nexus <- function(..., file = "", translate = TRUE, original.data = NULL) for (i in 1:ntree) { if (class(obj[[i]]) != "phylo") next - if (is.rooted(obj[[i]])) - cat("\tTREE *,", title[i], "= [&R] ", file = file, append = TRUE) - else cat("\tTREE *", title[i], "= [&U] ", file = file, append = TRUE) + root.tag <- if (is.rooted(obj[[i]])) "= [&R] " else "= [&U] " + cat("\tTREE *", title[i], root.tag, file = file, append = TRUE) cat(write.tree(obj[[i]], file = ""), "\n", sep = "", file = file, append = TRUE) }