display_matrix {spatialwarnings} | R Documentation |
Plot a matrix
Description
Display a matrix or a list of matrices in a plot
Usage
display_matrix(object, palette = "RdYlBu", along = NULL, ...)
Arguments
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. |
Details
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).
Value
A ggplot2 object, which is printed when this function is used interactively.
Examples
# 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)
[Package spatialwarnings version 3.0.3 Index]