Skip to content

Commit

Permalink
Merge pull request #115 from ms609/113-node-label-warning
Browse files Browse the repository at this point in the history
Warn if node labels mismatched
  • Loading branch information
emmanuelparadis authored Apr 7, 2024
2 parents 92ed85e + 6bfef7e commit 44b811e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion R/write.tree.R
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ write.tree <-
brl <- !is.null(phy$edge.length)
nodelab <- !is.null(phy$node.label)
if (check_tips) phy$tip.label <- checkLabel(phy$tip.label)
if (nodelab) phy$node.label <- checkLabel(phy$node.label)
if (nodelab) {
if (length(phy[["node.label"]]) != phy[["Nnode"]]) {
warning("Length of node.label does not match number of nodes.")
}
phy$node.label <- checkLabel(phy$node.label)
}
f.d <- paste0(":%.", digits, "g")
n <- length(phy$tip.label)

Expand Down

0 comments on commit 44b811e

Please sign in to comment.