X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=R%2Fcollapse.singles.R;h=9762bb0538c4f91cb8fad224a9df0701d7869695;hb=92ef6853c5cb0e730dad1af9961064239a1d375f;hp=4d477ab1f3735e1e57ebea4c27fe3f059555a57b;hpb=f3426364b40c7c0e6aadf6ea2690716425abdfc9;p=ape.git diff --git a/R/collapse.singles.R b/R/collapse.singles.R index 4d477ab..9762bb0 100644 --- a/R/collapse.singles.R +++ b/R/collapse.singles.R @@ -29,7 +29,7 @@ collapse.singles <- function(tree) prev.node <- which(xmat[, 2] == i) next.node <- which(xmat[, 1] == i) xmat[prev.node, 2] <- xmat[next.node, 2] - xmat <- xmat[xmat[, 1] != i, ] ## drop + xmat <- xmat[xmat[, 1] != i, ] # drop ## changed by EP for the new coding of "phylo" (2006-10-05): ## xmat[xmat < i] <- xmat[xmat < i] + 1 ## adjust indices xmat[xmat > i] <- xmat[xmat > i] - 1 ## adjust indices @@ -37,7 +37,7 @@ collapse.singles <- function(tree) elen[prev.node] <- elen[prev.node] + elen[next.node] ## added by Elizabeth Purdom (2008-06-19): if (!is.null(node.lab)) node.lab <- node.lab[-c(i - ntip)] - nnode <- nnode - 1 + nnode <- nnode - 1L ## end elen <- elen[-next.node] }