expand_matrix: Double the dimensions of a matrix

View source: R/advanced.R

expand_matrixR Documentation

Double the dimensions of a matrix

Description

A function to double the size of a matrix, with each cell in the original becoming four cells in the expanded matrix.

Usage

expand_matrix(m)

Arguments

m

A matrix.

Value

A matrix with the same distribution of values as the original, but doubled in size along both dimensions.

Examples

m <- matrix(1:6, nrow = 2)
expand_matrix(m)


kstreet13/mazing documentation built on May 12, 2024, 10:32 a.m.