R: Replicate columns/rows

Replicate columns/rows {Rfast} | 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))

[Package Rfast version 2.0.4 Index]