Description Usage Arguments Details See Also Examples
View source: R/manip-methods.R
Returns a tree with a new tip ID added
1 2 3 4 5 6 7 8 9 |
tree |
|
tid |
tip ID |
sid |
ID of node that will become new tip sisters |
strt_age |
timepoint at which new tips first appear in the tree |
end_age |
timepoint at which new tips end appear in the tree, default 0. |
tree_age |
age of tree |
pid |
parent ID (default is 'p_' + tid) |
User must provide new tip ID, the ID of the node
which will become the new tip's sister, and new branch lengths.
The tip ID must only contain letters numbers and underscores.
Optionally, user can specify the IDs for the new parental internal nodes.
Ensure that the strt_age
is greater than the end_age
, and that
the strt_age
falls within the age span of the sister ID. Otherwise, negative
spns may be produced leading to an error.
Note, returned tree will not have a node matrix.
Note, providing negative end ages will increase the age of the tree.
rmTips
,
https://github.com/DomBennett/treeman/wiki/manip-methods
1 2 3 4 5 6 7 8 9 | library(treeman)
tree <- randTree(10)
tree_age <- getAge(tree)
possible_ages <- getSpnAge(tree, 't1', tree_age)
start_age <- runif(1, possible_ages[['end']], possible_ages[['start']])
end_age <- possible_ages[['end']]
tree <- addTip(tree, tid='t11', sid='t1', strt_age=start_age,
end_age=end_age, tree_age=tree_age)
summary(tree)
|
Tree (TreeMan Object):
+ 11 tips
+ 10 internal nodes
+ Binary
+ PD 11
+ Root node is "n1"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.