Re: [R-sig-phylo] Counting and getting the age of cherries in a tree

2023-01-10 Thread Ivan Magalhaes
This was exactly what I needed -- thanks a lot!!Best,Ivan -- Dr. Ivan L. F. Magalhaes Postdoctoral fellow — División AracnologíaMuseo Argentino de Ciencias Naturales  "Bernardino Rivadavia"  Av. Ángel Gallardo 470, C1405DJR, Buenos Aires, Argentina+54 11 4982-8370 ext. 169Website | ResearchGate

Re: [R-sig-phylo] Counting and getting the age of cherries in a tree

2023-01-09 Thread Liam J. Revell
Hi Ivan. Try this simple code: ## load packages library(phytools) library(phangorn) ## get tips descended from each node dd<-Descendants(tree,node=1:tree$Nnode+Ntip(tree),     type="tips") names(dd)<-1:tree$Nnode+Ntip(tree) ## get the NUMBER of tips from each node nn<-sapply(dd,length) ## get

[R-sig-phylo] Counting and getting the age of cherries in a tree

2023-01-09 Thread Ivan Magalhaes
Hi all, Perhaps a dumb question, but is there an easy way to count the number of cherries in a given tree, and fetch their ages? (i.e. all the nodes with exactly two descendants) Thanks! Best,Ivan -- Dr. Ivan L. F. Magalhaes Postdoctoral fellow — División AracnologíaMuseo Argentino de Ciencias