repRow | R Documentation |
Wrapper for replicating a matrix/vector by rows or columns.
repRow(x, n)
repCol(x, n)
x |
a numerical vector or matrix of dimension |
n |
the number of replicates of |
A matrix of dimension c(nr * n, nc)
for repRow
or
c(nr, nc * n)
for repCol
.
repRow(1:5, 2)
repCol(1:5, 2)
A <- rbind(1:5, 5:1)
A
repRow(A, 2)
repCol(A, 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.