This function wraps the sim.char
in geiger function to simulate evolutionary models under a given evolutionary rate matrix, with the option of simulating multiple within-species observations and missing data.
sim.traits(ntaxa = 15, ntraits = 4, nreps = 1,
nmissing = 0, tree, v, anc, intraspecific,
model = "BM", parameters, nsim = 1, return.type = "matrix")
Number of species to randomly generate on a pure-birth phylogeny (used if tree
is not provided).
Number of traits to randomly simulate according to a random evolutionary rate matrix (used if v
is not provided).
Number of within-species observations to simulate (default is 1).
Number of observations to randomly remove from the simulated data (default is 0).
Optional: an object of class phylo
(if none provided, a random pure-birth phylogeny of size ntraxa is generated).
The evolutionary covariance matrix. If none provided, a random covariance matrix of size ntraits-by-ntraits is generated.
An optional vector of ancestral values.
An optional vector of within-species variance.
The evolutionary model to simulate trait evolution (BM, OUrandomRoot, OUfixedRoot, EB, lambda, kappa, or delta).
The evolutionary model parameter in a named list. Example: list(lambda = 0.5)
Number of datasets to simulate.
"data.frame" or "matrix"
Simulated trait data
The phylogenetic tree
The phylogenetic tree with specified branch length transformations
Harmon Luke J, Jason T Weir, Chad D Brock, Richard E Glor, and Wendell Challenger. 2008. GEIGER: investigating evolutionary radiations. Bioinformatics 24:129-131.