Skip to content
Prev 273573 / 398506 Next

Populate a matrix

This last solution is what I was looking for, I was trying to avoid loops. Thanks!

-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Rainer Schuermann
Sent: 5. oktober 2011 18:29
To: r-help at r-project.org
Subject: Re: [R] Populate a matrix

m <- matrix( rep( y, length( x ) ), length( y ), length( x ) )
On Wednesday 05 October 2011 18:11:18 fernando.cabrera at nordea.com wrote:
columns (length(x)), and each row is the corresponding y element repeated length(x) times.
______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.