[R] Problem with data frame

Rich at mango-solutions.com Rich at mango-solutions.com
Mon Apr 24 11:19:28 CEST 2006

Try this ...

> rDf <- data.frame(sapply(1:20, rnorm, n=500, mean=0)) 


S & R Training & Consulting
Tel    +44 1249 467 467
Fax   +44 1249 467 468

-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Arun Kumar Saha
Sent: 24 April 2006 10:15
To: r-help at stat.math.ethz.ch
Subject: [R] Problem with data frame

Dear r-users,

suppose I have n normal distributions with parameter N(0,i) i=1,2,.......,n

Now I want to generate 500 random number for each distribution. And want to
put all 500*n random numbers
in a single data frame.

I tried with following code:

random = data.frame(n)
for ( i in 2: length)
    random[,i] = random(500,mean=0,sd=i)

but while executing this I am getting errors.

Can anyone give me any suggestion?
Thanks and  regards

	[[alternative HTML version deleted]]

R-help at stat.math.ethz.ch mailing list
PLEASE do read the posting guide!

More information about the R-help mailing list