h_ridgelines: Plot diversification rates estimated by a HiSSE model with...

Description Usage Arguments Value Examples

View source: R/utilhisse.R

Description

A function to plot a ridgeline of (model-averaged) diversification rates in the alternative states. We can change the rate plotted on the y axis and modify the label for the x-axis (your binary 0/1 trait). Further modifications are straightforward with ggplot (see examples).

Usage

1
2
3
4
5
6
7
8
h_ridgelines(
  processed_recon,
  parameter = "turnover",
  states_names = c("Marine", "Freshwater"),
  line_colors = c("black", "black"),
  fill_colors = c("yellow", "red"),
  plot_as_waiting_time = FALSE
)

Arguments

processed_recon

An object produced by h_process_recon

parameter

The diversification parameter to be plotted on the y axis. Possible options are turnover, extinct.frac, net.div, speciation, extinction

states_names

The names for character states

line_colors

Colors for the lines and points

fill_colors

Colors for the density polygons

plot_as_waiting_time

Whether to plot the rates (FALSE, default) or their inverse (waiting times)

Value

A ridgeline plot of tip-associated rates (possibly model averaged).

Examples

1
2
3
4
5
6
7
8
9
data("diatoms")
processed_hisse <- h_process_recon(hisse_recon=diatoms$cid4_recon)

h_ridgelines(
 processed_recon = processed_hisse,
 states_names = c("Plankton", "Benthos"),
 parameter = "extinction",
 line_colors = c("black", "black"),
 fill_colors = c("orange", "violet"))

teofiln/utilhisse documentation built on Sept. 3, 2020, 2:55 p.m.