These are several functions I have written in the open-source statistical framework ‘R’, feel free to use them, change them etc. and let me know if you find issues. However they are not maintained and have not been updated since they were written.
For my code and tutorials explaining phylogenetic comparative methods follow this link.
For my code and tutorials explaining phylogenetic comparative methods follow this link.
CrownStemcladeAge function. This function takes a set of trees and a data.frame with species names as row.names and a higher-taxonomic clade they are assigned to in the first column. Using this data it calculates the crown and stem age of the clade across a set of trees summarizing the results as the maximum, minimum and median clade age across all trees. This function requires ape and phytools packages and was written for R v.2.15 Download R code:
crownstemcladeagefunction.r |
SimmapAge. This code provides a set of functions that process phylo trees (class Phylo) with mapped edges that have either been read into R using read.simmap or created in the make.simmap function available in the phytools package. transAges is the main function that calculates the ages of all the transitions of a particular type (0->1, 1->0 etc.) all other functions are used by this function. transTotal may also be useful on its own as it calculates the total number of transitions on the tree (regardless of type) but this function is now available in phytools.. This function requires the ape package and was written for R v.2.15.
simmapages.r |