simulate_char_unit: Simulate character evolution on unit tree

View source: R/sim.charUnit.R

simulate_char_unitR Documentation

Simulate character evolution on unit tree

Description

Simulates continuous characters along a unit tree according to a Brownian motion process with rate 1.

Usage

simulate_char_unit(unit.tree, nsim = 1000)

Arguments

unit.tree

a 'unit.tree' object

nsim

the number of datasets to simulate (if single unit.tree is provided; see below)

Details

If a single unit.tree is supplied, the function will simulate nsim datasets under a Brownian motion process with a rate of 1. If a list of unit.trees supplied (such as those derived from a Bayesian analysis) sim.char.unit will simulate a single data set on each tree in the list and the nsim argument will be ignored.

Value

A list of unit.trees. In each unit.tree, the phylogeny will be the same as that of the input unit.tree(s) but the data and the contrasts will be replaced by the simulated datasets.

Examples

data(finch)
phy <- finch$phy
dat <- finch$data[,"wingL"]

## build unit.tree object
unit.tree <- make_unit_tree(phy, data=dat)

## simulate 2 datasets on unit tree
sims <- simulate_char_unit(unit.tree, nsim=2)

sims


mwpennell/arbutus documentation built on Oct. 6, 2022, 10 a.m.