duplicate vector into matrix r -
wondering how duplicate vector matrix in r. example
v = 1:10 dup = duplicate(v,2)
where dup looks rbind(1:10,1:10). thanks
dup
rbind(1:10,1:10)
i think you're looking replicate.
replicate
t(replicate(2, v))
r vector matrix
No comments:
Post a Comment