plot_matrix: Plot a matrix

Description Usage Arguments Value Examples

View source: R/plot.R

Description

This function allows us to plot matrices easily

Usage

1
2
3
4
plot_matrix(x, ...)

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

Arguments

x

a matrix

...

for S3 generic API consistency; does nothing

Value

a ggplot object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
T <- TRUE; F <- FALSE
x1 <- m(T, T, T, F, T |
        T, T, F, T, T |
        F, T, T, T, F |
        T, T, T, T, T |
        F, F, T, T, T |
        F, T, T, T, F)
plot_matrix(x1)
x2 <- m(T, T, T, F, T |
        T, T, F, T, T )
plot(x2)
x3 <- m(runif(3) | runif(3) | runif(3))
plot(x3)

matricks documentation built on March 26, 2020, 6:22 p.m.