expand_matrix: Expand a matrix with given rownames and colnames

View source: R/expand_matrix.R

expand_matrixR Documentation

Expand a matrix with given rownames and colnames

Description

Expand a matrix with given rownames and colnames

Usage

expand_matrix(mat, rownames = NULL, colnames = NULL, fill = 0)

Arguments

mat

The matrix to expand

rownames

The desired rownames

colnames

The desired colnames

fill

With what to fill missing data

Examples

x <- matrix(runif(12), ncol = 4, dimnames = list(c("a", "c", "d"), c("D", "F", "H", "I")))
expand_matrix(x, letters[1:5], LETTERS[1:10], fill = 0)

dynutils documentation built on Oct. 11, 2022, 5:07 p.m.