add.trendline: Plotting Trendlines on a Phylogeny

Description Usage Arguments Value Author(s) See Also Examples

Description

This function can be used to add a trendline for some given variable to an ultrametric phylogenetic tree.

Usage

1
add.trendline(phy, x, axis = TRUE, ...)

Arguments

phy

An object of class phylo.

x

A matrix, containing data points: x-values (ages) in the first column, y-values in the second columns.

axis

A logical indicating if a y-axis should be plotted.

...

Further arguments to be passed to lines.

Value

none

Author(s)

Christoph Heibl

See Also

add.timeframe

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# phylogenetic tree of wild barley
# --------------------------------
data(hordeum)

# plot tree
# ---------
plot(hordeum)

# use some dummy data ...
# -----------------------
x <- seq(from = 12, to = 0, length.out = 15)
y <- c(1, 2, 4, 4, 6, 5, 11, 13, 15, 16, 12, 14, 15, 17, 18)
data <- cbind(x, y)

# ... to plot trendline:
# ----------------------
add.trendline(hordeum, x = data, col = "red", lty = 2)
axisChrono()

fmichonneau/phyloch documentation built on May 16, 2019, 1:45 p.m.