Dear R helpers,
 
I know this is a simple task, but I'm new to R and I'm still havind 
difficulties with the language.
I want to create 30 vectors to be used in a simulation, each with 1 columm and 
5 lines, of random numbers N(0,1).
What I tried was this:
 
N=150
u2<-rep(1:150,0)
u2<-list(matrix(0,5))
u2
for(i in 1:N)
{
u2[i]<-rnorm(5)
}
u2

### also tried this:

N=150
u2<-rep((matrix(0,5)),30)
u2
for(i in 1:N)
{
u2[i]<-rnorm(5)
}
u2

 
The problem is none of this gives me the random numbers arranged in vectors.
I've tried other variations too, but haven't managed to get it through.
 
Any help is very welcome.
Kind regards,
Iara
        [[alternative HTML version deleted]]

______________________________________________
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
and provide commented, minimal, self-contained, reproducible code.

Reply via email to