Description Usage Arguments Value Author(s) References Examples
View source: R/transformPhylo.sim.R
Simulates continuous trait data under a range of evolutionary models
1 |
phy |
An object of class "phylo" (see ape package). |
n |
Number of simulations |
x |
Vector, matrix or data.frame (with taxon names as names or rownames) of categories for each species. Only applicable if model="mixedRate" |
model |
The model of trait evolution (see details). |
kappa |
Value of kappa transform. |
lambda |
Value of lambda transform. |
delta |
Value of delta transform. |
alpha |
Value of alpha (OU) transform. |
psi |
Value of psi transform. |
nodeIDs |
Integer - ancestral nodes of clades. |
rateType |
If rate is to be inferred on single branches leading to clades then rateType="branches". If rate is inferred for whole clade, rateType="clade" |
branchRates |
Numeric vector specifying relative rates for individual branches. |
cladeRates |
Numeric vector specifying relative rates for clades. |
rate |
a vector of relative rate parameters. The length of the vector is equal to the number of rates being estimated. |
group.means |
a vector of the relative difference in means between rate categories, expressed as a scalar applied to the expected standard deviation (see Ricklefs 2006) |
Returns a matrix of simulated dated with taxon names as rownames (number of columns=n).
Gavin Thomas
Ricklefs RE. 2006. Time, species, and the generation of trait variation in clades. Systematic Biology 55, 151-159.
Thomas GH, Meiri S, & Phillimore AB. 2009. Body size diversification in Anolis: novel environments and island effects. Evolution 63, 2017-2030.
1 2 3 4 5 6 7 8 9 10 | data(anolis.tree)
data(anolis.data)
# Simulate 10 sets of data with kappa=0.1 using the anolis tree
sim.dat1 <- transformPhylo.sim(phy=anolis.tree, n=10, model="kappa", kappa=0.1)
# Simulate 10 sets of data where rates and means differ between to the categories defined by "x"
x <- anolis.data$geo_ecomorph
names(x) <- rownames(anolis.data)
sim.dat2 <- transformPhylo.sim(phy=anolis.tree, n=10, x=x, model="mixedRate", rate=c(1,1,2,4), group.means=c(0,5,0,0))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.