Description Usage Arguments Details Value Author(s) See Also Examples
Reads a file containing an ultrametric tree in parenthetic format and returns a numeric vector of branching times, sorted from earliest to most recent.
1 |
file |
a file containing a single tree in 'newick' (parenthetic) format |
string |
the name of an object containing a 'newick' tree character string |
This function requires the package ape. If ape has not been attached to the search path but exists in the R directory, it will automatically be loaded. If ape does not exist, you must install it by typing install.packages("ape") at the R prompt.
If tree is not ultrametric, an error message will be generated.
a numeric vector of branching times
Dan Rabosky drabosky@umich.edu
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | data(agamids)
write.table(agamids, file = 'example.tre', quote=FALSE,
row.names = FALSE, col.names = FALSE)
# the preceding lines generate a file 'example.tre' that can be
# read by 'getBtimes'
agbtimes <- getBtimes(file = 'example.tre')
#or alternatively:
agbtimes <- getBtimes(string = agamids)
#agbtimes is now a numeric vector of branching times
plotLtt(agbtimes) #plot log-lineages through time for agamid data
gamStat(agbtimes) #calculate gamma statistic for agamid data
unlink('example.tre') #clean-up.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.