plot.ancestralCauchy {cauphy}R Documentation

Plot for class ancestralCauchy

Description

This function takes an object of class ancestralCauchy, result of function ancestral or increment, and plots the reconstructed states for given nodes.

Usage

## S3 method for class 'ancestralCauchy'
plot(x, node, n_col, intervals = NULL, ...)

Arguments

x

an object of class ancestralCauchy, result of function ancestral or increment.

node

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.

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 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.

Value

None.

See Also

plot_asr, ancestral, increment, fitCauchy

Examples

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")


[Package cauphy version 1.0.2 Index]