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, ...)
an object of class ancestralCauchy
, result of function
ancestral
or increment
.
the vector of nodes where to plot the ancestral reconstruction.
Can be missing, in which case all the nodes reconstructed in the ancestralCauchy
object are plotted.
the number of columns on which to display the plot. Can be missing, in which case a default number is used.
a list of HDI intervals produced by function hdi.ancestralCauchy
.
If the HDI of a plotted node is in the list, then it is plotted by the function.
further arguments to be passed to plot
.
None.
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")