Description Usage Arguments Details Value Author(s) See Also

View source: R/FPK_sim_traitgram.R

Simulates a trait evolving according to the FPK model and also plots evolution along branches of this tree using a traitgram.

1 2 | ```
FPK_sim_traitgram(tree, x0, a, b, c, bounds, sigsq, time_step, res.x = 200
, ylim.plot = NULL, return.trait = FALSE)
``` |

`tree` |
The phylogenetic tree on which to simulate the trait evolving. |

`x0` |
The initial value of the trait (at the root of the tree). |

`a` |
The coefficient for the x^4 term of the potential. |

`b` |
The coefficient for the quadratic term of the potential. |

`c` |
The coefficient for the linear term of the potential. |

`bounds` |
The bounds on the trait interval. |

`sigsq` |
The evolutionary rate. |

`time_step` |
The time step for incremental simulations (should be smaller that the shortest branch in the tree). |

`res.x` |
The number of points to use for discretizing the trait interval. |

`ylim.plot` |
The y limits of the plot. If left to NULL, the bounds of the trait interval will be used, but you might want to zoom in a bit more if the bounds are not reached. |

`return.trait` |
If set to TRUE, the function returns a named vector of trait values at the tips of the tree. |

The function is slower than Sim_FPK since it simulates step by step along branches. It should be used to visualize trait evolution, but Sim_FPK should be preferred for quick simulations.

The function is mainly designed to produce a plot, but eventually returns a named vector of trait values at the tips of the tree.

F. C. Boucher

BBMV documentation built on April 30, 2018, 9:03 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.