repvec | R Documentation |
Create matrices by repeating vectors row-wise or column-wise a specified number of times.
repvec(x, n = 1, dim = NULL, nrow = NULL, ncol = NULL)
x |
Scalar or vector. |
n |
Integer specifying the number of times |
dim |
Integer specifying along which dimension |
nrow |
Integer specifying the number of row-wise repetitions of |
ncol |
Integer specifying the number of column-wise repetitions of |
repvec(1, 12) # Column vector of ones.
repvec(1, ncol = 12) # Row vector of ones.
repvec(1:10, 12, dim = 2) # 10x12 matrix with 1:10 in each column.
repvec(1:10, 12, dim = 1) # 12x10 matrix with 1:10 in each row.
repvec(1:10, ncol = 12) # 10x12 matrix with 1:10 in each column.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.