plot.board: plot.board method; plots a "board" class object

Description Usage Arguments Value Examples

View source: R/visualize.R View source: R/visualize.R

Description

plot.board method; plots a "board" class object

plot.board method updated; includes a grid which if TRUE is represneted visually by gray dashed lines

Usage

1
2
3
4
5
## S3 method for class 'board'
plot(x, grid = TRUE)

## S3 method for class 'board'
plot(x, grid = TRUE)

Arguments

x

a "board" object (superclass - matrix, subclass - board)

grid

a boolean, to decide whether the plot should contain dashed grid lines or not

x

a "board" object (superclass - matrix, subclass - board)

Value

a tile plot containing squares that represent the elements of "board" (superclass matrix); black for 0s, white for 1s, and light blue for 2s

a tile plot containing squares that represent the elements of "board" (superclass matrix); black for 0s, white for 1s, and light blue for 2s; if grid = TRUE, adds dashed gray lines to geom_tile

Examples

1
2
plot(board_example), plot(board_example2), plot(board_example3), plot(board_example4)
plot(board_example, grid = TRUE), plot(board_example2, grid = TRUE), plot(board_example3, grid = TRUE), plot(board_example4, grid = TRUE)

adityagandhi81298/percolate documentation built on Nov. 1, 2019, 8:54 p.m.