-## rTrait.R (2011-06-16)
+## rTrait.R (2012-02-09)
## Trait Evolution
-## Copyright 2010-2011 Emmanuel Paradis
+## Copyright 2010-2012 Emmanuel Paradis
## This file is part of the R-package `ape'.
## See the file ../COPYING for licensing issues.
diag(Q) <- -rowSums(Q)
for (i in N:1) {
p <- matexpo(Q * el[i])[x[anc[i]], ]
- x[des[i]] <- .Internal(sample(k, size = 1, FALSE, prob = p))
+ x[des[i]] <- sample.int(k, size = 1, FALSE, prob = p)
}
}
rTraitCont <-
function(phy, model = "BM", sigma = 0.1, alpha = 1, theta = 0,
- ancestor = FALSE, root.value = 0, linear = TRUE, ...)
+ ancestor = FALSE, root.value = 0, ...)
{
if (is.null(phy$edge.length))
stop("tree has no branch length")
if (length(theta) == 1) theta <- rep(theta, N)
else if (length(theta) != N)
stop("'theta' must have one or Nedge(phy) elements")
- if (!linear) model <- model + 1L
}
.C("rTraitCont", as.integer(model), as.integer(N),
as.integer(anc - 1L), as.integer(des - 1L), el,