I know that if I want to generate for example 120 numbers from normal distribution with mean 30 and standard deviation 20 i can do it by command :
x=rnorm(120,30,20)
But what if I want to generate 100 times 120 numbers from above normal distribution ?
Do we have in R any function to do this directly ?
help("replicate")- duckmayrmatrix(rnorm(100*120,30,20),nrow=100)- Ben Bolkerrnorm(120*100, 30,20)will do that - but I suspect your question should say you want 100 sets of random numbers in order to something with each set. So Ben Bolker's answer will put each set into each row of a matrix. What do you want to do with your random numbers? - Spacedman