repmat: Repeat Vectors and Matrices

View source: R/convenience.R

repmatR Documentation

Repeat Vectors and Matrices

Description

Repeat a vector or matrix a specific number of times.

Usage

repmat(x, m, n)

Arguments

x

A vector or matrix.

m

Integer specifying how many times to repeat x in the first dimension.

n

Integer specifying how many times to repeat x in the second dimension.

Value

A block matrix of dimension m*nrow(x) by n*ncol(x).

Examples

repmat(1:3, 3, 2) # will have dimension 9 by 2
repmat(randn(2, 2), 3, 2)

ramify documentation built on June 24, 2025, 9:07 a.m.