Re: [R] repeat a function

2017-11-03 Thread Eric.Pueyo
Thanks Petr. Really appreciated! Many thanks, Eric -Original Message- From: PIKAL Petr [mailto:petr.pi...@precheza.cz] Sent: 03 November 2017 07:54 To: Eric Pueyo; r-help@r-project.org Subject: RE: [R] repeat a function Hi Well, I am not an expert in this field so I cannot comment

Re: [R] repeat a function

2017-11-03 Thread PIKAL Petr
om: eric.pu...@avivainvestors.com [mailto:eric.pu...@avivainvestors.com] > Sent: Thursday, November 2, 2017 5:54 PM > To: PIKAL Petr ; r-help@r-project.org > Subject: RE: [R] repeat a function > > Hi Petr, > > Many thanks for your response. > > Basically I want to create a pr

Re: [R] repeat a function

2017-11-02 Thread Eric.Pueyo
j,sep = ""),"1"] <<- ProbUP(a,j,dt) prb[paste(j,sep = ""),"0"] <<- ProbMID(a,j,dt) prb[paste(j,sep = ""),"-1"] <<- ProbDWN(a,j,dt) prb[paste(-j,sep = ""),"1"] <<- ProbUP(a,-j,d

Re: [R] repeat a function

2017-11-02 Thread Bert Gunter
Petr et al. : I only wish to comment on Petr's remark; I have nothing useful to say about the subject of this thread. "AFAIK if a function is defined within another function (which is your case) it cannot be called directly so it is necessary to define it in global environment." Right, a deliber

Re: [R] repeat a function

2017-11-02 Thread PIKAL Petr
Hi Eric I did not see any answer and frankly speaking I cannot provide you with canned help. AFAIK if a function is defined within another function (which is your case) it cannot be called directly so it is necessary to define it in global environment. > fff <- function(x) { + myf <- functio

Re: [R] repeat a function

2010-09-29 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Michael Bedward > Sent: Wednesday, September 29, 2010 5:34 PM > To: Michael Larkin; Rhelp > Subject: Re: [R] repeat a function > > On 30 September 20

Re: [R] repeat a function

2010-09-29 Thread Michael Bedward
On 30 September 2010 02:48, Michael Larkin wrote: > > > > testdat <- replicate( 50, growth[ sample(nrow(growth), 8, rep=TRUE) ] ) > > I can't seem to get it to work.  I keep getting the error message of > "undefined columns selected" > > Any advice? I'd need to know the dimensions of your matrix

Re: [R] repeat a function

2010-09-28 Thread Michael Bedward
Hi Michael testdat <- replicate( 50, growth[ sample(nrow(growth), 8, rep=TRUE) ] ) testdat will then be a matrix of 8 x 50 = 400 rows where each lot of 8 is a sample. Alternatively you can do... testdat <- replicate( 50, growth[ sample(nrow(growth), 8, rep=TRUE) ], simplify=FALSE ) Now testdat