Description Usage Arguments Details Value Examples
Simulate a coalescent tree.
1 |
method |
simulation method: ‘hudson’ for the continuous time approximations; ‘generations’ for the generation-by-generation algorithm |
sample |
number of sampled lineages |
current |
current population size |
ancestral |
ancestral population size |
time |
time at which the population changed in size |
A coalescent tree is built using either the ‘hudson’'s approximation in continuous time, or a generation-by-generation algorithm. A single population is simulated, and ‘sample’ lineages are simulated. The population is assumed to have a current effective size (‘current’), and an ancestral effective size (‘ancestral’). The change in population size occurred ‘time’ generations in the past
an object of class ‘coalescent’ which is a list with components:
node |
the list of nodes (internal and leafs) in the tree |
ancestor |
the ancestor of each node |
label |
the label of each leaf |
branch.length |
the length of the branch above each node |
1 2 3 4 5 | ## This is to simulate a coalescent tree using the Hudson's algorithm,
## with 20 sampled lineages. In this example, the current population size
## is 100. It was 1000 before a bottleneck that occurred 50 generations ago
tree <- sim.tree(method = "hudson",sample = 20,current = 100,ancestral = 1000,time = 50)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.