display_matrix: Plot a matrix

View source: R/display_matrix.R

display_matrixR 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 *_sews functions or indictest()

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 object is a matrix, this is ignored.

...

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)


spatialwarnings documentation built on March 21, 2022, 5:08 p.m.