View source: R/plot_life_cycle.R
plot_life_cycle | R Documentation |
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/.
plot_life_cycle(
matA,
stages,
title = NULL,
shape = "egg",
fontsize = 10,
nodefontsize = 12,
edgecol = "grey",
node_order = NULL
)
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 |
title |
Optional title for the plot. Defaults to |
shape |
The shape to be used for the stages of the diagram. Any node
shape accepted by |
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. |
node_order |
An optional numeric vector giving the order that the nodes should be presented in the plot. Default is 'NULL' whereby the order is the same as 'stages', or row/column names, of the matrix. |
An object of class grViz
representing the life cycle diagram
Owen R. Jones <jones@biology.sdu.dk>
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)
# Change the order of the nodes and give them names
plot_life_cycle(matA,
stages = c("A", "B", "C", "D", "E"),
node_order = 5:1
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.