Dear phylofolks,

I'm trying to root a tree on an internal (rather than a terminal) branch.
Here is a small example:

t5 <- rmtree(N = 1, n = 5, rooted = FALSE)[[1]]
root(t5, node = 6, resolve.root = TRUE)

output:  Error in if (i != N) { : argument is of length zero

root(t5, node = 7, resolve.root = TRUE)

output: Phylogenetic tree with 5 tips and 4 internal nodes.

Tip labels:
[1] "t4" "t3" "t2" "t5" "t1"

Rooted; includes branch lengths.

I don't understand why rooting at node 6 throws an error, while using node
7 is fine. What am I missing?



Luiz Max Fagundes de Carvalho
PhD student, Institute of Evolutionary Biology,  School of Biological
Ashworth Laboratories, Ash 2, office 123
University of Edinburgh, United Kingdom.

        [[alternative HTML version deleted]]

R-sig-phylo mailing list -
Searchable archive at

Reply via email to