Re: [R] Re : Elegant Code

2012-03-16 Thread Raphael Fraser
>> >> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] >> >> On Behalf Of Pascal Oettli >> >> Sent: Friday, March 16, 2012 12:36 AM >> >> To: Raphael Fraser >> >> Cc: r-help@r-project.org >> >>

Re: [R] Re : Elegant Code

2012-03-16 Thread Ranjan Maitra
rdlund > wrote: > > > >> -Original Message- > >> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > >> On Behalf Of Pascal Oettli > >> Sent: Friday, March 16, 2012 12:36 AM > >> To: Raphael Fraser > >> Cc:

Re: [R] Re : Elegant Code

2012-03-16 Thread Raphael Fraser
ay, March 16, 2012 12:36 AM >> To: Raphael Fraser >> Cc: r-help@r-project.org >> Subject: [R] Re : Elegant Code >> >> Hi Raphael, >> >> Something like that? >> >> require(pscl)sim <- numeric() >> for(i in 1:5){ >>   eval(parse(text

Re: [R] Re : Elegant Code

2012-03-16 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Pascal Oettli > Sent: Friday, March 16, 2012 12:36 AM > To: Raphael Fraser > Cc: r-help@r-project.org > Subject: [R] Re : Elegant Code > > Hi Raphae

[R] Re : Elegant Code

2012-03-16 Thread Pascal Oettli
Hi Raphael, Something like that? require(pscl)sim <- numeric() for(i in 1:5){   eval(parse(text=paste('b',i,' <- rigamma(50,1,1)',sep='')))   eval(parse(text=paste('theta',i,' <- rgamma(50,0.5,(1/b',i,'))',sep='')))   eval(parse(text=paste('sim',i,' <- rpois(50,theta',1,')',sep='')))   eval(parse