Hi, I did a search but I was able to find how to generate a random matrix. Can somebody let me know how to do it? Regards, Peng
On 25/08/2009, at 10:17 AM, Peng Yu wrote:> Hi, > > I did a search but I was able to find how to generate a random matrix. > Can somebody let me know how to do it?Uhhh, generate some random numbers and then arrange them in a matrix? ?matrix ?runif ?rnorm ?rgamma . . . cheers, Rolf Turner ###################################################################### Attention:\ This e-mail message is privileged and confid...{{dropped:9}}
Like tris: NCols=5 NRows=7 myMat<-matrix(runif(NCols*NRows), ncol=NCols) myMat bests milton On Mon, Aug 24, 2009 at 6:17 PM, Peng Yu <pengyu.ut@gmail.com> wrote:> Hi, > > I did a search but I was able to find how to generate a random matrix. > Can somebody let me know how to do it? > > Regards, > Peng > > ______________________________________________ > R-help@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<http://www.r-project.org/posting-guide.html> > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]
Thanks. bb=replicate(2, rnorm(20)) was very useful for me. -- View this message in context: http://r.789695.n4.nabble.com/How-to-create-a-random-matrix-tp901667p3912806.html Sent from the R help mailing list archive at Nabble.com.