Re: [R] Random number datasets help

2009-06-19 Thread Marc Schwartz
On Jun 19, 2009, at 10:25 AM, Alexandre Lockhart wrote: My other question involved formatting my output. Normally, my text file has 8 columns, each column with 500 values before the next 8 below are generated, and so on until 28 are reached. I have examined formatting issues with each f

Re: [R] Random number datasets help

2009-06-19 Thread Alexandre Lockhart
[1], x[2])) sink() > From: marc_schwa...@me.com > To: jholt...@gmail.com > Date: Thu, 18 Jun 2009 15:23:06 -0500 > CC: r-help@r-project.org; alexandre_geor...@hotmail.com > Subject: Re: [R] Random number datasets help > > Quite true Jim, however I focused on his request and not hi

Re: [R] Random number datasets help

2009-06-18 Thread Alexandre Lockhart
You're absolutely right, Marc. Thanks > From: marc_schwa...@me.com > To: jholt...@gmail.com > Date: Thu, 18 Jun 2009 15:23:06 -0500 > CC: r-help@r-project.org; alexandre_geor...@hotmail.com > Subject: Re: [R] Random number datasets help > > Quite true Jim, howeve

Re: [R] Random number datasets help

2009-06-18 Thread Marc Schwartz
Quite true Jim, however I focused on his request and not his code, presuming that he did not realize what he was doing as a consequence of the nested loops. Perhaps Alexandre can provide clarification? Regards, Marc On Jun 18, 2009, at 2:46 PM, jim holtman wrote: That is not what his 'for

Re: [R] Random number datasets help

2009-06-18 Thread jim holtman
That is not what his 'for' loops are doing. He is iterating through all combinations and would have created 784. So his problem statement did not match the code that he sent. On Thu, Jun 18, 2009 at 2:12 PM, Marc Schwartz wrote: > Alexandre did say 28 datasets, not 784 (28 * 28) > > Thus,

Re: [R] Random number datasets help

2009-06-18 Thread David Winsemius
On Jun 18, 2009, at 1:10 PM, Alexandre Lockhart wrote: Hello: My problem is that I have a data frame of means, and a data frame of standard deviations which match up to each mean. I have been trying to create 500 random numbers in a given dataset for each mean/sd combination, but I am

Re: [R] Random number datasets help

2009-06-18 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of Henrique Dallazuanna > Sent: Thursday, June 18, 2009 10:52 AM > To: Alexandre Lockhart > Cc: r-help@r-project.org > Subject: Re: [R] Random number datasets he

Re: [R] Random number datasets help

2009-06-18 Thread Marc Schwartz
Alexandre did say 28 datasets, not 784 (28 * 28) Thus, either: mapply(rnorm, n = 500, mean = a1, sd = a2) or apply(cbind(a1, a2), 1, function(x) rnorm(500, x[1], x[2])) HTH, Marc Schwartz On Jun 18, 2009, at 12:51 PM, Henrique Dallazuanna wrote: Try this also: a <- expand.grid(a

Re: [R] Random number datasets help

2009-06-18 Thread Henrique Dallazuanna
Try this also: a <- expand.grid(a1, a2) x <- mapply(rnorm, n = 500, mean = a[,1], sd = a[,2]) On Thu, Jun 18, 2009 at 2:10 PM, Alexandre Lockhart < alexandre_geor...@hotmail.com> wrote: > > Hello: > > My problem is that I have a data frame of means, and a data frame of > standard deviations whic

Re: [R] Random number datasets help

2009-06-18 Thread jim holtman
try this: > a1<-c(178.07,178.28,178.08,177.74,177.04,178.17,177.58,57.71,59.6,60.92,59.48,59.32,61.59,59.94,28.9,29.82,30.73,25.68,27.93,28.98,29.76,123.48,127.27,127.8,127.2,127.13,126.71,125.5) > a2<-c(1.69,1.3,1,.18,1.53,1.31,1.35,1.83,1.56,1.12,.74,1.48,1.67,1.53,.95,.87,0.03,1.12,1.95,1.22,1.

[R] Random number datasets help

2009-06-18 Thread Alexandre Lockhart
Hello: My problem is that I have a data frame of means, and a data frame of standard deviations which match up to each mean. I have been trying to create 500 random numbers in a given dataset for each mean/sd combination, but I am only able to generate the last value in each data set to creat