Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

plot_life_cycle

Plot a life cycle diagram from a matrix population model


Description

Plots the life cycle diagram illustrated by a matrix population model. This function processes the matrix model and passes the information to the graphViz function in DiagrammeR. See http://rich-iannone.github.io/DiagrammeR/.

Usage

plot_life_cycle(
  matA,
  stages,
  title = NULL,
  shape = "egg",
  fontsize = 10,
  nodefontsize = 12,
  edgecol = "grey"
)

Arguments

matA

A matrix population model (i.e. a square projection matrix)

stages

Optional vector of stage class labels. If missing, it first attempts to infer them from dimnames(matA). If these are also NULL, then reverts to integers 1:ncol(A).

title

Optional title for the plot. Defaults to NULL.

shape

The shape to be used for the stages of the diagram. Any node shape accepted by graphViz is acceptable.

fontsize

Size of the font used in the diagram.

nodefontsize

Size of the font used in the node part of the diagram.

edgecol

Colour of the arrows in the diagram.

Value

An object of class grViz representing the life cycle diagram

Author(s)

Owen R. Jones <jones@biology.sdu.dk>

Examples

matA <- rbind(c(0.1,   0,   0,   0, 1.4),
              c(0.5, 0.2,   0,   0,   0),
              c(  0, 0.3, 0.3,   0,   0),
              c(  0,   0, 0.4, 0.4, 0.1),
              c(  0,   0,   0, 0.1, 0.4))

plot_life_cycle(matA)

Rage

Life History Metrics from Matrix Population Models

v1.0.0
GPL-3
Authors
Patrick Barks [aut] (<https://orcid.org/0000-0002-5947-8151>), Danny Buss [ctb], Pol Capdevila [aut] (<https://orcid.org/0000-0002-2842-4302>), Hal Caswell [aut] (<https://orcid.org/0000-0003-4394-6894>), Judy P. Che-Castaldo [aut] (<https://orcid.org/0000-0002-9118-9202>), John Jackson [aut] (<https://orcid.org/0000-0002-4563-2840>), Tamora James [aut] (<https://orcid.org/0000-0003-1363-4742>), Owen Jones [aut, cre] (<https://orcid.org/0000-0001-5720-4686>), Sam Levin [aut] (<https://orcid.org/0000-0002-3289-9925>), William K. Petry [aut] (<https://orcid.org/0000-0002-5230-5987>), Roberto Salguero-Gomez [aut] (<https://orcid.org/0000-0002-6085-4433>), Caroline Schuette [ctb] (<https://orcid.org/0000-0002-2063-8736>), Iain Stott [aut] (<https://orcid.org/0000-0003-2724-7436>), Chelsea C. Thomas [aut] (<https://orcid.org/0000-0002-8155-9353>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.