Hi, A tree has n terminal nodes (aka tips) and m internal nodes (aka nodes simply). In the edge matrix, the tips are numbered 1:n and the nodes are numbered (n+1):(n+m) (same than n+1:m). n and m can be found with:
n <- Ntip(tree) # or length(tree$tip.label) m <- Nnode(tree) # or tree$Nnode Details can be found in: http://ape-package.ird.fr/misc/FormatTreeR.pdf Best, Emmanuel ----- Le 5 Sep 21, à 21:07, Nick Youngblut nyoun...@gmail.com a écrit : > For `ape::dist.nodes()`, how can one match the output matrix rows/columns with > the node IDs in the tree (eg., the tip.labels)? I cannot just use > `ape::cophenetic()` in my particular situation. The docs for > `ape::dist.nodes()` state: > > ``` > … in the case of dist.nodes, the numbers of the tips and the nodes (as given > by > the element edge). > ``` > > … but tree$edge doesn’t provide any direct info about which nodes are internal > vs external and how the external tip labels map to the tree$edge matrix. > > Thanks, > Nick > _______________________________________________ > R-sig-phylo mailing list - R-sig-phylo@r-project.org > https://stat.ethz.ch/mailman/listinfo/r-sig-phylo > Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/ _______________________________________________ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/