plot.ancestralCauchy | R Documentation |
ancestralCauchy
This function takes an object of class ancestralCauchy
, result of function
ancestral
or increment
, and plots the reconstructed states for given nodes.
## S3 method for class 'ancestralCauchy'
plot(x, node, n_col, intervals = NULL, ...)
x |
an object of class |
node |
the vector of nodes where to plot the ancestral reconstruction.
Can be missing, in which case all the nodes reconstructed in the |
n_col |
the number of columns on which to display the plot. Can be missing, in which case a default number is used. |
intervals |
a list of HDI intervals produced by function |
... |
further arguments to be passed to |
None.
plot_asr
, ancestral
, increment
, fitCauchy
set.seed(1289)
# Simulate tree and data
phy <- ape::rphylo(10, 0.1, 0)
dat <- rTraitCauchy(n = 1, phy = phy, model = "cauchy",
parameters = list(root.value = 10, disp = 0.1))
# Fit the data
fit <- fitCauchy(phy, dat, model = "cauchy", method = "reml")
# Reconstruct the ancestral values
inc <- increment(fit, node = c(3, 8), values = seq(-3, 3, 0.01))
plot(inc, type = "l")
anc <- ancestral(fit, node = c(12, 17), n_values = 1000)
plot(anc, type = "l")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.