move.lineage {RRphylo} | R Documentation |
Move tips or clades
Description
Move a single tip or an entire clade to a different position within the tree.
Usage
move.lineage(tree,focal,sister,rescale=TRUE,rootage=NULL)
Arguments
tree |
a phylogenetic tree. The tree needs not to be ultrametric and fully dichotomous. |
focal |
the lineage to be moved. It can be either a tip name/number or a
node number. If |
sister |
the sister tip/node where the |
rescale |
logical. If the most recent common ancestor of the
|
rootage |
the age of the tree root to be supplied if |
Value
The phylogenetic tree with required topological changes.
Author(s)
Silvia Castiglione, Pasquale Raia
Examples
require(phytools)
DataCetaceans$tree->tree
### Case 1. Moving a single tip
# sister to a tip
move.lineage(tree,focal="Orcinus_orca",sister="Balaenoptera_musculus")
# sister to a clade
move.lineage(tree,focal="Orcinus_orca",sister=131)
# sister to a clade by using tree$node.label
move.lineage(tree,focal="Balaenoptera_musculus",sister="Clade Delphinida")
# sister to a specific genus
move.lineage(tree,focal="Orcinus_orca",sister="Genus Balaenoptera")
# sister to the tree root with and without rootage
move.lineage(tree,focal="Balaenoptera_musculus",sister=117)
move.lineage(tree,focal="Balaenoptera_musculus",sister=117,rootage=max(diag(vcv(tree))))
### Case 2. Moving a clade
# sister to a tip
move.lineage(tree,focal="Genus Mesoplodon",sister="Balaenoptera_musculus")
move.lineage(tree,focal="Clade Delphinida",sister="Balaenoptera_musculus")
move.lineage(tree,focal=159,sister="Balaenoptera_musculus")
# sister to a clade
move.lineage(tree,focal="Genus Mesoplodon",sister=131)
move.lineage(tree,focal="Clade Delphinida",sister=131)
move.lineage(tree,focal=159,sister=131)
# sister to a clade by using tree$node.label
move.lineage(tree,focal="Genus Mesoplodon",sister="Clade Plicogulae")
move.lineage(tree,focal="Clade Delphinida",sister="Clade Plicogulae")
move.lineage(tree,focal=159,sister="Clade Plicogulae")
# sister to a specific genus
move.lineage(tree,focal="Genus Mesoplodon",sister="Genus Balaenoptera")
move.lineage(tree,focal="Clade Delphinida",sister="Genus Balaenoptera")
move.lineage(tree,focal=159,sister="Genus Balaenoptera")
# sister to the tree root with and without rootage
move.lineage(tree,focal="Genus Mesoplodon",sister=117)
move.lineage(tree,focal="Clade Delphinida",sister=117)
move.lineage(tree,focal=159,sister=117)
move.lineage(tree,focal="Genus Mesoplodon",sister=117,rootage=max(diag(vcv(tree))))
move.lineage(tree,focal="Clade Delphinida",sister=117,rootage=max(diag(vcv(tree))))
move.lineage(tree,focal=159,sister=117,rootage=max(diag(vcv(tree))))