repRow: Replication of rows and columns

View source: R/auxiliary.R

repRowR Documentation

Replication of rows and columns

Description

Wrapper for replicating a matrix/vector by rows or columns.

Usage

repRow(x, n)

repCol(x, n)

Arguments

x

a numerical vector or matrix of dimension c(nr, nc).

n

the number of replicates of x by rows or columns.

Value

A matrix of dimension c(nr * n, nc) for repRow or c(nr, nc * n) for repCol.

Examples

repRow(1:5, 2)
repCol(1:5, 2)
A <- rbind(1:5, 5:1)
A
repRow(A, 2)
repCol(A, 2)

egarpor/sdetorus documentation built on March 4, 2024, 1:23 a.m.