rTraitCauchy | R Documentation |
Simulate a continuous trait using the Cauchy Process
rTraitCauchy(
n = 1,
phy,
model = c("cauchy", "lambda", "kappa", "delta"),
parameters = NULL
)
n |
number of independent replicates |
phy |
a phylogeny in |
model |
a phylogenetic model. Default is "cauchy", for the Cauchy process. Alternative are "lambda", "kappa", and "delta". |
parameters |
list of parameters for the model (see Details). |
The default choice of parameters is as follow:
model = cauchy
root.value = 0
, disp = 1
model = lambda
root.value = 0
, disp = 1
, lambda = 1
model = kappa
root.value = 0
, disp = 1
, kappa = 1
model = delta
root.value = 0
, disp = 1
, delta = 1
If n=1, a numeric vector with names from the tip labels in the tree. For more than 1 replicate, a matrix with the tip labels as row names, and one column per replicate.
rTrait
, rTraitCont
set.seed(1289)
phy <- ape::rphylo(40, 0.01, 0)
# One trait
y <- rTraitCauchy(n = 1, phy = phy, model = "cauchy",
parameters = list(root.value = 0, disp = 0.1))
y
plot(phy, x.lim = c(0, 750))
phydataplot(y, phy, offset = 150)
# Many trait
y <- rTraitCauchy(n = 10, phy = phy, model = "cauchy",
parameters = list(root.value = 0, disp = 0.1))
head(y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.