X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=man%2FrTraitDisc.Rd;h=a800c465b032b7457f4344cb1055c07210d0b6be;hb=2014b83971be4b9cd1644d6127837df798e9335c;hp=967042eeaa135f3807af16641254a6f2fbe334e6;hpb=24fc6c03893f85a3f9ab3d088201b3731f3035b4;p=ape.git diff --git a/man/rTraitDisc.Rd b/man/rTraitDisc.Rd index 967042e..a800c46 100644 --- a/man/rTraitDisc.Rd +++ b/man/rTraitDisc.Rd @@ -4,7 +4,7 @@ \usage{ rTraitDisc(phy, model = "ER", k = if (is.matrix(model)) ncol(model) else 2, rate = 0.1, states = LETTERS[1:k], freq = rep(1/k, k), - ancestor = FALSE, root.value = 1) + ancestor = FALSE, root.value = 1, ...) } \arguments{ \item{phy}{an object of class \code{"phylo"}.} @@ -24,6 +24,8 @@ rTraitDisc(phy, model = "ER", k = if (is.matrix(model)) ncol(model) else 2, \item{root.value}{an integer giving the value at the root (by default, it's the first state). To have a random value, use \code{root.value = sample(k)}.} + \item{\dots}{further arguments passed to \code{model} if it is a + function.} } \description{ This function simulates the evolution of a discrete character along a @@ -42,7 +44,7 @@ rTraitDisc(phy, model = "ER", k = if (is.matrix(model)) ncol(model) else 2, always ignored. The arguments \code{k} and \code{rate} are ignored.} \item{A character:}{these are the same short-cuts than in the function - \link{\code{ace}}: \code{"ER"} is an equal-rates model, \code{"ARD"} + \code{\link{ace}}: \code{"ER"} is an equal-rates model, \code{"ARD"} is an all-rates-different model, and \code{"SYM"} is a symmetrical model. Note that the argument \code{rate} must be of the appropriate length, i.e., 1, \eqn{k(k - 1)}, or \eqn{k(k - 1)/2} for the three models, @@ -63,15 +65,24 @@ rTraitDisc(phy, model = "ER", k = if (is.matrix(model)) ncol(model) else 2, } \author{Emmanuel Paradis} \seealso{ - \code{\link{rTraitCont}}, \code{\link{ace}} + \code{\link{rTraitCont}}, \code{\link{rTraitMult}}, \code{\link{ace}} } \examples{ data(bird.orders) ### the two followings are the same: rTraitDisc(bird.orders) rTraitDisc(bird.orders, model = matrix(c(0, 0.1, 0.1, 0), 2)) + ### two-state model with irreversibility: rTraitDisc(bird.orders, model = matrix(c(0, 0, 0.1, 0), 2)) + +### simple two-state model: +tr <- rcoal(n <- 40, br = runif) +x <- rTraitDisc(tr, ancestor = TRUE) +plot(tr, show.tip.label = FALSE) +nodelabels(pch = 19, col = x[-(1:n)]) +tiplabels(pch = 19, col = x[1:n]) + ### an imaginary model with stasis 0.5 time unit after a node, then ### random evolution: foo <- function(x, l) {