Re: [R] Error: if statement: missing value where TRUE/FALSE needed

2022-01-06 Thread Chuck Coleman via R-help
I added the sink() commands to capture the output I was seeing and saw no noticeable difference.  Granted, I didn't look too hard.  Still, the code ran for the usual time before the error.  Remove the print() commands and you'll probably the error in an entirely different iteration. Thanks for

Re: [R] Error: if statement: missing value where TRUE/FALSE needed

2022-01-06 Thread Duncan Murdoch
I've downloaded your code, and I'm seeing some strange results. When I source MetroTest.R, it creates a log file ending Error in if (xseg[w1] > ub & m == 1) olrmark[wi] = TRUE else if (xseg[w1] < : missing value where TRUE/FALSE needed as you saw. But when I comment out the sink() lines

Re: [R] Error: if statement: missing value where TRUE/FALSE needed

2022-01-06 Thread Chuck Coleman via R-help
I've created a git repository at  https://sourceforge.net/p/rhelp/code/ci/master/tree/.  I've used git before, so that's what I chose.  I had forgotten that sourceforge didn't have a download all files command.  I don't post files often. About the semantics of "crash":  Perhaps I'm showing my ag

Re: [R] Error: if statement: missing value where TRUE/FALSE needed

2022-01-05 Thread Duncan Murdoch
On 05/01/2022 2:09 p.m., Ivan Krylov wrote: On Wed, 5 Jan 2022 21:22:37 +0300 Ivan Krylov wrote: How exactly do you check for a missing argument? To answer my own question, the check is browser(expr = { is.na(w1) | is.na(ub) | is.na(m) | is.na(wi) | is.na(lb) }) I think that there are

Re: [R] Error: if statement: missing value where TRUE/FALSE needed

2022-01-05 Thread Ivan Krylov
On Wed, 5 Jan 2022 21:22:37 +0300 Ivan Krylov wrote: > How exactly do you check for a missing argument? To answer my own question, the check is >> browser(expr = { >> is.na(w1) | is.na(ub) | is.na(m) | is.na(wi) | is.na(lb) >> }) I think that there are NAs in xseg, which I don't see a check f

Re: [R] Error: if statement: missing value where TRUE/FALSE needed

2022-01-05 Thread Duncan Murdoch
On 05/01/2022 10:47 a.m., Chuck Coleman via R-help wrote: This is a rather complex error, for which I created  https://sourceforge.net/projects/rhelp/files/Metro/ to hold a minimal workspace with all files needed to make everything work.  I'm afraid I can't make a minimal example because the en

Re: [R] Error: if statement: missing value where TRUE/FALSE needed

2022-01-05 Thread Bill Dunlap
And how does one [easily] download those files from sourceforge? -Bill On Wed, Jan 5, 2022 at 10:15 AM Chuck Coleman via R-help < r-help@r-project.org> wrote: > This is a rather complex error, for which I created > https://sourceforge.net/projects/rhelp/files/Metro/ to hold a minimal > workspace

Re: [R] Error: if statement: missing value where TRUE/FALSE needed

2022-01-05 Thread Ivan Krylov
On Wed, 5 Jan 2022 15:47:07 + (UTC) Chuck Coleman via R-help wrote: > I then made the browser() statement conditional to stop execution if > a missing argument were encountered and detectspikes() happily passed > it and crashed. How exactly do you check for a missing argument? Could options

[R] Error: if statement: missing value where TRUE/FALSE needed

2022-01-05 Thread Chuck Coleman via R-help
This is a rather complex error, for which I created  https://sourceforge.net/projects/rhelp/files/Metro/ to hold a minimal workspace with all files needed to make everything work.  I'm afraid I can't make a minimal example because the environment may be involved.  I suspect that it is an error w