Re: [R] generate matrices

2012-02-09 Thread Bert Gunter
Inline below. -- Bert On Thu, Feb 9, 2012 at 8:59 AM, David Winsemius wrote: > > On Feb 9, 2012, at 8:38 AM, Blaz Simcic wrote: > >> Dear all, >> I would like to generate 500 matrices of 20 numbers from >> standard normal distribution with names x1,x2,x3,….x500. >> I tried with loop for, but I d

Re: [R] generate matrices

2012-02-09 Thread David Winsemius
On Feb 9, 2012, at 8:38 AM, Blaz Simcic wrote: Dear all, I would like to generate 500 matrices of 20 numbers from standard normal distribution with names x1,x2,x3,….x500. I tried with loop for, but I don’t know how to name matices : for (i in 1:500) { x[[i]] <- matrix(rnorm(20), 4) } An

Re: [R] generate matrices

2012-02-09 Thread Jorge I Velez
What about this? B <- 500 X <- matrix(rnorm(B*20), ncol = B) colnames(X) <- paste('x', 1:B, sep = "") head(X) Thus, each column correspond to a sample of 20 numbers from a standard normal distribution. HTH, Jorge.- On Thu, Feb 9, 2012 at 8:38 AM, Blaz Simcic <> wrote: > Dear all, > I would li

[R] generate matrices

2012-02-09 Thread Blaz Simcic
Dear all, I would like to generate 500 matrices of 20 numbers from standard normal distribution with names x1,x2,x3,….x500.   I tried with loop for, but I don’t know how to name matices : for (i in 1:500)  {    x[[i]] <- matrix(rnorm(20), 4)     } Any suggestion? Thanks,  Blaž