Hi Mario, I would recommend you working with R library “treeman” (https://github.com/DomBennett/treeman/wiki <https://github.com/DomBennett/treeman/wiki>). Nodes are stored in a list and it is easy working with them. For each node in the list you have the info of the precedent and posterior nodes, so you can create a function to recursively compute the number of tips for each node.
—------------------------------- Miguel Camacho Sánchez miguelcamchosanchez.weebly.com <https://twitter.com/intent/follow?original_referer=https://about.twitter.com/resources/buttons®ion=follow_link&screen_name=Sunda_Miguel&tw_p=followbutton> <http://www.researchgate.net/profile/Miguel_Camacho4> > El 4 ago 2019, a las 2:32, Mario Schädel <mario.schae...@gmail.com> escribió: > > Dear people on this list, > > I am a German PhD student in the field of arthropod palaeontology. I want to > develop a new approach for comparing abundance data in a phylogenetic > context. Unlike following the standard techniques of community ecology, I > want to include the abundance data not only for the tips of a tree but also > for its nodes. The background for this is, that in palaeontology it is often > not possible to identify specimens to species level and also some fossils are > better preserved as others, hence the level of identification within samples > can vary a lot. > So, I want to link a vector, or at best a data frame, that holds abundance > data for tips and nodes, to a tree (even this proved to be problematic as all > functions that I found make distinctions between tip and node data). In the > next step, I would like to recursively sum-up the abundances along the tree, > from the leaves to the root. When the data is properly linked, this should > not be too complicated, once the tree is reordered into the “postorder” > format. Afterwards, the computed data should be converted in a format, that > can be included into plots. Alternatively, I also came up with the idea, that > the abundance data could be visualised by the branch lengths of the tree. > I would be more than grateful, if someone could offer me some help with this > project. I have been wrecking my head around this since months now. > I attached a graphical representation of my idea in case my explanations are > a bit confusing (orange color, abundances before computation; green, summed > up aundances). > > Best wishes to all of you! > Mario > > <Sketch.png>_______________________________________________ > 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/ [[alternative HTML version deleted]] _______________________________________________ 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/