Two methods. The first produces a vector, the second a one column matrix.
x=1:10
# Method 1
rep(x,each=3)
# Method 2
matrix(t(matrix(x,length(x),3)))
Subscribe to:
Post Comments (Atom)
Functions and tips for use in the R statistical environment.
No comments:
Post a Comment