pad_matrix: Pad a matrix

View source: R/utils.R

pad_matrixR Documentation

Pad a matrix

Description

Pad a matrix

Usage

pad_matrix(x, pad_size = 1L, pad = 0L)

Arguments

x

The matrix to pad.

pad_size

An integer giving the number of columns/rows to pad with.

pad

A single value giving the padding.

Value

A matrix

Examples


x <- matrix(c(1:9), nrow = 3, ncol = 3)
beadplexr:::pad_matrix(x)

x <- matrix(c(1:4), nrow = 2, ncol = 2)
beadplexr:::pad_matrix(x)
beadplexr:::pad_matrix(x, pad_size = 2L)
beadplexr:::pad_matrix(x, pad = NA)
beadplexr:::pad_matrix(x, pad = "xx")

x <- matrix(c(1:6), nrow = 3, ncol = 2)
beadplexr:::pad_matrix(x)


beadplexr documentation built on July 9, 2023, 5:59 p.m.