Re: [R] help with recursive function

2017-12-14 Thread William Dunlap via R-help
.@gmail.com] > Sent: Thursday, December 14, 2017 10:29 AM > To: DIGHE, NILESH [AG/2362] <nilesh.di...@monsanto.com> > Cc: r-help <r-help@r-project.org> > Subject: Re: [R] help with recursive function > > If you are trying to understand why the "stopifnot" condit

Re: [R] help with recursive function

2017-12-14 Thread DIGHE, NILESH [AG/2362]
. Nilesh From: William Dunlap [mailto:wdun...@tibco.com] Sent: Thursday, December 14, 2017 11:26 AM To: DIGHE, NILESH [AG/2362] <nilesh.di...@monsanto.com> Cc: Eric Berger <ericjber...@gmail.com>; r-help <r-help@r-project.org> Subject: Re: [R] help with recursive function

Re: [R] help with recursive function

2017-12-14 Thread William Dunlap via R-help
Sent: Thursday, December 14, 2017 10:29 AM > To: DIGHE, NILESH [AG/2362] <nilesh.di...@monsanto.com> > Cc: r-help <r-help@r-project.org> > Subject: Re: [R] help with recursive function > > If you are trying to understand why the "stopifnot" condition is met yo

Re: [R] help with recursive function

2017-12-14 Thread DIGHE, NILESH [AG/2362]
] <nilesh.di...@monsanto.com> Cc: r-help <r-help@r-project.org> Subject: Re: [R] help with recursive function If you are trying to understand why the "stopifnot" condition is met you can replace it by something like: if ( any(dat2$norm_sd >= 1) ) browser() This will put y

Re: [R] help with recursive function

2017-12-14 Thread Eric Berger
ot;, "treatment"), >> >> "\\.") %>% spread(treatment, value) %>% mutate(outlier = NA) >> >> stopifnot(!(any(data1$norm_sd >= 1))) >> >> if (!(any(data1$norm_sd >= 1))) { >> >> df1 <

Re: [R] help with recursive function

2017-12-14 Thread Eric Berger
gt; return(df1) > > } > >else { > > df2 <- recursive_funlp() > > return(df2) > > } > > } > > df3 <- recursive_funlp(dataset = dat1, func = funlp2) > > df3 > > } > &

Re: [R] help with recursive function

2017-12-14 Thread DIGHE, NILESH [AG/2362]
recursive_funlp(dataset = dat1, func = funlp2) df3 } From: DIGHE, NILESH [AG/2362] Sent: Thursday, December 14, 2017 9:01 AM To: 'Eric Berger' <ericjber...@gmail.com> Cc: r-help <r-help@r-project.org> Subject: RE: [R] help with recursive function Eric: Thanks for taking

Re: [R] help with recursive function

2017-12-14 Thread DIGHE, NILESH [AG/2362]
ic Berger [mailto:ericjber...@gmail.com] Sent: Thursday, December 14, 2017 8:17 AM To: DIGHE, NILESH [AG/2362] <nilesh.di...@monsanto.com> Cc: r-help <r-help@r-project.org> Subject: Re: [R] help with recursive function My own typo ... whoops ... !( any(dat2$norm_sd >= 1 )) On Thu,

Re: [R] help with recursive function

2017-12-14 Thread Eric Berger
My own typo ... whoops ... !( any(dat2$norm_sd >= 1 )) On Thu, Dec 14, 2017 at 3:43 PM, Eric Berger wrote: > You seem to have a typo at this expression (and some others like it) > > Namely, you write > > any(!dat2$norm_sd) >= 1 > > when you possibly meant to write > >

Re: [R] help with recursive function

2017-12-14 Thread Eric Berger
You seem to have a typo at this expression (and some others like it) Namely, you write any(!dat2$norm_sd) >= 1 when you possibly meant to write !( any(dat2$norm_sd) >= 1 ) i.e. I think your ! seems to be in the wrong place. HTH, Eric On Thu, Dec 14, 2017 at 3:26 PM, DIGHE, NILESH [AG/2362]

[R] help with recursive function

2017-12-14 Thread DIGHE, NILESH [AG/2362]
Hi, I need some help with running a recursive function. I like to run funlp2 recursively. When I try to run recursive function in another function named "calclp" I get this "Error: any(!dat2$norm_sd) >= 1 is not TRUE". I have never built a recursive function before so having trouble executing