plot_punc_model: Plot data with or without a fit line

View source: R/plot_punc_model.r

plot_punc_modelR Documentation

Plot data with or without a fit line

Description

This function plots data with or without a fit line derived from the fit_punc_model function.

Usage

plot_punc_model(
  data,
  output_reg,
  size = 1,
  alpha = 1,
  fit = TRUE,
  type = c("extant", "serial", "fossil")
)

Arguments

data

A data frame with path length in the 1st column, node count in the 2nd, and time in the 3rd

output_reg

A list outputted from the fit_punc_model function

size

Size of data point

alpha

Transparency of data point (0: transparent; 1: opaque)

fit

If TRUE, the plot shows the phylogenetically-normalized fitted line but not the fitted plane derived from a multiple regression (path ~ time + node)

type

List of options:

  • extant: all taxa in the dataset are sampled at the "same" time (e.g., present-day mammal species)

  • serial: taxa are serially-sampled, and the timescale is in days to years (e.g., SARS-CoV-2 genomes)

  • fossil: taxa are serially-sampled, and the timescale is in hundreds to millions of years (e.g., extinct dinosaur species)

Value

This function returns an object of the ggplot class.

Author(s)

Kevin Surya

References

Freedman and Diaconis (1981); Webster et al. (2003); Pagel et al. (2006); Rambaut et al. (2016)


suryakevin/drugcandy documentation built on May 6, 2022, 6:37 p.m.