Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

grid_mat

Create a Character Grid Matrix


Description

Constructs a grid with provided dimensions (row, col), character values for gridlines, and a step parameter noting the number of rows and columns between each gridline.

Usage

grid_mat(
  dim,
  step = c(2, 2),
  text = c(".", ".", "+", "|", "|", "-", "-", rep("+", 8)),
  border = TRUE
)

Arguments

dim

(row, column) vector for size of grid.

step

numeric vector describing grid step across (rows, columns)

text

character vector of values for the grid, in order: horizontal grid line, vertical grid line, grid intersection, left border, right border, top border, bottom border, corners (upper-left, upper-right, lower-left, lower-right), ticks (right, bottom, left, top)

border

logical value for whether a border should be included.

Value

rowxcol matrix

See Also

Examples

grid_mat(dim=c(11,13), step=c(2,4), border=TRUE)

cursr

Cursor and Terminal Manipulation

v0.1.0
MIT + file LICENSE
Authors
Chris Mann
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.