search for: norm_sd

Displaying 9 results from an estimated 9 matches for "norm_sd".

2017 Dec 14
3
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 you in a debugging session where you can examine your variables, e.g. > dat$norm_sd HTH, Eric On Thu, Dec 14, 2017 at 5:33 PM, Eric Berger <ericjberger at gmail.com> wrote: > The message is coming from your stopifnot() condition being met. &g...
2017 Dec 14
0
help with recursive function
...017 10:29 AM To: DIGHE, NILESH [AG/2362] <nilesh.dighe at monsanto.com> Cc: r-help <r-help at 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 you in a debugging session where you can examine your variables, e.g. > dat$norm_sd HTH, Eric On Thu, Dec 14, 2017 at 5:33 PM, Eric Berger <ericjberger at gmail.com<mailto:ericjberger at gmail.com>> wrote: The message is coming from your st...
2017 Dec 14
2
help with recursive function
Hi, I accidently left out few lines of code from the calclp function. Updated function is pasted below. I am still getting the same error ?Error: !(any(data1$norm_sd >= 1)) is not TRUE? I would appreciate any help. Nilesh dput(calclp) function (dataset) { dat1 <- funlp1(dataset) recursive_funlp <- function(dataset = dat1, func = funlp2) { dat2 <- dataset %>% select(uniqueid, field_rep, lp) %>% mutate(field_rep = pa...
2017 Dec 14
1
help with recursive function
Your code contains the lines stopifnot(!(any(data1$norm_sd >= 1))) if (!(any(data1$norm_sd >= 1))) { df1 <- dat1 return(df1) } stop() "throws an error", causing the current function and all functions in the call stack to abort and return nothing. It does not mean to stop now and return...
2017 Dec 14
0
help with recursive function
...ition being met. On Thu, Dec 14, 2017 at 5:31 PM, DIGHE, NILESH [AG/2362] < nilesh.dighe at monsanto.com> wrote: > Hi, I accidently left out few lines of code from the calclp function. > Updated function is pasted below. > > I am still getting the same error ?Error: !(any(data1$norm_sd >= 1)) is > not TRUE? > > > > I would appreciate any help. > > Nilesh > > dput(calclp) > > function (dataset) > > { > > dat1 <- funlp1(dataset) > > recursive_funlp <- function(dataset = dat1, func = funlp2) { > > dat2...
2017 Dec 14
0
help with recursive function
Eric: Thanks for taking time to look into my problem. Despite of making the change you suggested, I am still getting the same error. I am wondering if the logic I am using in the stopifnot and if functions is a problem. I like the recursive function to stop whenever the norm_sd column has zero values that are above or equal to 1. Below is the calclp function after the changes you suggested. Thanks. Nilesh dput(calclp) function (dataset) { dat1 <- funlp1(dataset) recursive_funlp <- function(dataset = dat1, func = funlp2) { dat2 <- dataset %>% s...
2017 Dec 14
2
help with recursive function
My own typo ... whoops ... !( any(dat2$norm_sd >= 1 )) On Thu, Dec 14, 2017 at 3:43 PM, Eric Berger <ericjberger at gmail.com> 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 > > !( any(...
2017 Dec 14
0
help with recursive function
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] < nilesh.dighe at monsanto.com> wrote: > Hi, I need some help with running a recursive func...
2017 Dec 14
2
help with recursive function
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 it in this case. I would appreciate any help or guidance to resolve this issue. Please see my data and the three functions that I am using below. Please note that calclp is the function I am run...