Replicate columns/rows | R Documentation |
Replicate columns/rows.
rep_col(x,n)
rep_row(x,n)
x |
A vector with data. |
n |
Number of new columns/rows. |
A matrix where each column/row is equal to "x".
Manos Papadakis
R implementation and documentation: Manos Papadakis <papadakm95@gmail.com>.
rowMins, rowFalse, nth, colrange, colMedians, colVars, colSort, rowSort, rowTrue
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.