rep_col: Replicate columns/rows

View source: R/replicate.R

Replicate columns/rows R Documentation

Replicate columns/rows

Description

Replicate columns/rows.

Usage

rep_col(x,n)
rep_row(x,n)

Arguments

x

A vector with data.

n

Number of new columns/rows.

Value

A matrix where each column/row is equal to "x".

Author(s)

Manos Papadakis

R implementation and documentation: Manos Papadakis <papadakm95@gmail.com>.

See Also

rowMins, rowFalse, nth, colrange, colMedians, colVars, colSort, rowSort, rowTrue

Examples

x <- runif(10)
all.equal(rep_col(x,10),matrix(x,nrow=length(x),ncol=10))
all.equal(rep_row(x,10),matrix(x,ncol=length(x),nrow=10,byrow=TRUE))

Rfast documentation built on Nov. 9, 2023, 5:06 p.m.