plot_matrix | R Documentation |
Visualise a matrix, such as a matrix population model (MPM), as a heatmap.
plot_matrix(mat, zero_na = FALSE, legend = FALSE, na_colour = NA, ...)
mat |
A matrix, such as the A matrix of a matrix population model |
zero_na |
Logical indicating whether zero values should be treated as NA |
legend |
Logical indicating whether to include a legend |
na_colour |
Colour for NA values |
... |
Additional arguments to be passed to ggplot |
A ggplot object
Owen Jones jones@biology.sdu.dk
Other utility:
summarise_mpms()
matDim <- 10
A1 <- make_leslie_mpm(
survival = seq(0.1, 0.7, length.out = matDim),
fecundity = seq(0.1, 0.7, length.out = matDim),
n_stages = matDim
)
plot_matrix(A1, zero_na = TRUE, na_colour = "black")
plot_matrix(A1, zero_na = TRUE, na_colour = NA)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.