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

Ivan Krylov kry|ov@r00t @end|ng |rom gm@||@com
Wed Jan 5 20:09:53 CET 2022


On Wed, 5 Jan 2022 21:22:37 +0300
Ivan Krylov <krylov.r00t using gmail.com> 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 for. In
particular, a few lines above, there's

>> md = median( xseg, na.rm = TRUE);
>> if (robust) sdd = mad(xseg,na.rm = TRUE)
>> else sdd = sd(xseg,na.rm = TRUE)

...which seems to suggest they are expected to happen there.

Not sure which advice to give regarding the choice of file hosting
service. On the one hand, SourceForge lets you upload a whole directory
of files in arbitrary formats, but isn't very convenient do download
more than one file from. On the other hand, "pastebin" services like
http://paste.debian.net/ or http://paste.org.ru/ let us browse the code
right away, without having to look at the "Your download will start
shortly..." screen, but don't host *.RData or more than one file per
link. I guess that some other code hosting service like
SourceHut/GitHub/GitLab/Gitea/... could fulfil both criteria.

-- 
Best regards,
Ivan



More information about the R-help mailing list