h_dotplot: 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 dotplot of (model-averaged) diversification rates in the alternative states.

Usage

1
2
3
4
5
6
7
8
h_dotplot(
  processed_recon,
  parameter = "turnover",
  states_names = c("Marine", "Freshwater"),
  bin_width = 0.1,
  colors,
  plot_as_waiting_time = TRUE
)

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

A character vector of length two giving the translation for states 0 and 1.

bin_width

The width of bins for the dotplot. Treat this as any histogram. Testing several different bin width values is recommended.

colors

Colors for the points in the two alternate states

plot_as_waiting_time

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

Value

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

Examples

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

h_dotplot(
  processed_recon = processed_hisse,
  parameter = "turnover",
  states_names = c("Plankton", "Benthos"),
  bin_width = 0.2,
  colors=c("orange", "violet"),
  plot_as_waiting_time = TRUE
) + labs(x = "", y = "Waiting time (My)", title = "Turnover")

# see ?h_scatterplot for examples for modifying the graph using ggplot2

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