m_rate_recon: Plot MuHiSSE model-averaged marginal ancestral state...

Description Usage Arguments Value Examples

View source: R/utilhisse.R

Description

A function to plot a (model-averaged) marginal ancestral reconstruction for the estimated diversification rates.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
m_rate_recon(
  processed_recon,
  show_tip_labels = FALSE,
  parameter = "turnover",
  discrete = FALSE,
  breaks = seq(0.3, 0.6, 1),
  colors = c("red", "blue", "orange", "green"),
  plot_as_waiting_time = FALSE,
  tree_layout = "rectangular",
  tree_direction = "right",
  time_axis_ticks = 10,
  open_angle = 10
)

Arguments

processed_recon

An object produced by h_process_recon

show_tip_labels

Logical, whether to plot tip labels. Default is FALSE because it is difficult to plot legible tip labels for larger trees common in this type of analysis. See ?m_trait_recon for a good manual solution.

parameter

The diversification parameter to be mapped onto the tree. Possible options are turnover, extinct.frac, net.div, speciation, extinction

discrete

Logical. Whether to discretize the distribution of reconstructed rates into bins

breaks

A numeric vector of cut points for binning the rates. Passed internally to cut. The function checks whether 0 and max(rate) is in this vector and adds them if not. Scale appropriatelly if plot_as_waiting_time=TRUE.

colors

Colors for the branches. If discrete=TRUE a vector of length matching the number of bins produced by the breaks. If discrete=FALSE, a vector of length two giving the min/max of a color gradient.

plot_as_waiting_time

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

tree_layout

A layout for the tree. Available options are 'rectangular' (default), 'slanted', 'circular', 'fan' and 'radial'.

tree_direction

'right' (default), 'left', 'up', or 'down' for rectangular and slanted tree layouts

time_axis_ticks

numeric giving the number of ticks for the time axis (default=10)

open_angle

The degrees of empty space between the first and last tip. Only works for tree_layout = 'fan' and allows for a little more space around axis tick labels.

Value

A plot of the phylogeny with branches colored by hisse-inferred marginal ancestral states.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data("diatoms")
processed_muhisse <- m_process_recon(muhisse_recon=diatoms$muhisse_recon)

m_rate_recon(
   processed_recon = processed_muhisse,
   parameter = "extinction", discrete=FALSE)

m_rate_recon(
   processed_recon = processed_muhisse,
   parameter = "extinction", discrete=TRUE, breaks=c(0.3, 0.6, 1))

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