View source: R/add.species.to.genus.R
add.species.to.genus | R Documentation |
add.species.to.genus
adds an additional species to a genus on a phylogeny.
genus.to.species.tree
simulates pure-birth subtrees and then binds them at a random height along the terminal edge leading to each corresponding genus on a genus-level backbone tree.
add.species.to.genus(tree, species, genus=NULL, where=c("root","random"))
genus.to.species.tree(tree, species)
tree |
an object of class |
species |
string contain species name in the format |
genus |
for |
where |
for |
For add.species.to.genus
, if genus
contains only one species and where="root"
, then species
will be attached midway along the branch leading to the one species. If where="random"
then species
will be added at a random position along the edge.
If genus
cannot be found in the tree, then the original tree is returned and a warning printed. If the tree is not ultrametric, then the resultant tree may not contain branch lengths and a warning will be printed.
Note that for some cases in which a tree is read in from file, R may initially think it is ultrametric, but then later (as tips are added) decide that it is not due to rounding of the edge lengths when it was written to file. This can most likely be resolved by using force.ultrametric
to coerce the tree to be exactly ultrametric (to the maximum numerical precision permitted by R) before adding tips to the tree.
If genus
is non-monophyletic then species
will be attached to the most inclusive group containing members of genus
and a warning will be printed.
An object of class "phylo"
.
Liam Revell liam.revell@umb.edu
Revell, L. J. (2024) phytools 2.0: an updated R ecosystem for phylogenetic comparative methods (and other things). PeerJ, 12, e16505.
add.random
, bind.tip
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.