plot.hero_adjacent: Plot a 'hero_adjacent' object

View source: R/plot.hero_adjacent.R

plot.hero_adjacentR Documentation

Plot a hero_adjacent object

Description

Plot a hero_adjacent object. x$nbrs is used to construct a sparseMatrix-class object. The default behavior is to plot the sparse matrix using the image function. However, if the igraph package is installed, a graph is made using graph_from_adjacency_matrix and then plotted using plot.igraph.

Usage

## S3 method for class 'hero_adjacent'
plot(x, ...)

Arguments

x

A hero_adjacent object

...

Additional arguments passed to image, or if the igraph package is installed, plot.igraph.

Examples

coords = expand.grid(1:4, 1:4)
a = adjacent(coords, digits = 1)
plot(a)

hero documentation built on July 26, 2023, 5:11 p.m.