rep_col: Replicate columns/rows

Description Usage Arguments Value Author(s) See Also Examples

View source: R/replicate.R

Description

Replicate columns/rows.

Usage

1
2
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

1
2
3
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))

Example output

Loading required package: Rcpp
Loading required package: RcppZiggurat
[1] TRUE
[1] TRUE

Rfast documentation built on Dec. 11, 2021, 9:59 a.m.