powered by
Fast generation of a matrix by replicating a matrix row- and column-wise in a block-like fashion
repmat(x, nrow = 1L, ncol = 1L)
A matrix with dimensions r*c.
An integer giving the number of times the matrix is replicated row-wise
An integer giving the number of times the matrix is replicated column-wise
A matrix with dimensions (r*nrow) x (c*ncol)
# NOT RUN { 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 # }
Run the code above in your browser using DataLab