Replicate columns/rows
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>.
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))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.