View source: R/display_matrix.R
display_matrix | R Documentation |
Display a matrix or a list of matrices in a plot
display_matrix(object, palette = "RdYlBu", along = NULL, ...)
object |
A matrix, a list of matrices, an object produced by
|
palette |
A color palette to use in the plot. It can be any color palette understood by scale_fill_brewer. |
along |
A vector of values used in facet headers. If |
... |
Other arguments are ignored. |
This function will plot a matrix using ggplot2, using the provided
palette. Its use-case is very much like image()
, but its produces
nicer plots by default (image()
is much faster, however).
A ggplot2 object, which is printed when this function is used interactively.
# display_matrix works with single matrices or lists of matrices
display_matrix(serengeti[2:3])
# display_matrix is compatible with "*_sews" objects
indics <- compute_indicator(serengeti[2:3], raw_moran)
display_matrix(indics)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.