repmat: Fast replication of a matrix

Description Usage Arguments Value Author(s) Examples

View source: R/RcppExports.R

Description

Fast generation of a matrix by replicating a matrix row- and column-wise in a block-like fashion

Usage

1
repmat(x, nrow = 1L, ncol = 1L)

Arguments

x

A matrix with dimensions r*c.

nrow

An integer giving the number of times the matrix is replicated row-wise

ncol

An integer giving the number of times the matrix is replicated column-wise

Value

A matrix with dimensions (r*nrow) x (c*ncol)

Author(s)

Claus Ekstrom <claus@rprimer.dk>

Examples

1
2
3
m <- matrix(1:6, ncol=3)
repmat(m, 2)     # Stack two copies of m on top of each other
repmat(m, 2, 3)  # Replicate m with two copies on top and three copies side-by-side 


MESS documentation built on May 19, 2017, 11:55 a.m.
Search within the MESS package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.