From pd@|gd @end|ng |rom gm@||@com  Sun Jun 23 10:53:57 2019
From: pd@|gd @end|ng |rom gm@||@com (peter dalgaard)
Date: Sun, 23 Jun 2019 10:53:57 +0200
Subject: [Rd] methods package: A _R_CHECK_LENGTH_1_LOGIC2_=true error
In-Reply-To: <CAFDcVCQOWVr0p2e2HONOy9NvqPdpoAH=HPMOEP65K-N6UjhA2g@mail.gmail.com>
References: <CAFDcVCQOWVr0p2e2HONOy9NvqPdpoAH=HPMOEP65K-N6UjhA2g@mail.gmail.com>
Message-ID: <67D2E7FE-74E3-4379-B9FB-C4028AB808DF@gmail.com>

This looks obvious enough, so I just committed your fix to R-devel and R-patched.

I'm at the wrong machine for thorough testing, but at least it seems to build OK. However, I sense some risk that this could uncover sleeping bugs elsewhere, so watch out.

-pd

> On 22 Jun 2019, at 18:49 , Henrik Bengtsson <henrik.bengtsson at gmail.com> wrote:
> 
> DISCLAIMER: I can not get this error with R --vanilla, so it only
> occurs when some other package is also loaded.  I don't have time to
> find to narrow that down for a reproducible example, but I believe the
> following error in R 3.6.0:
> 
>> Sys.setenv("_R_CHECK_LENGTH_1_LOGIC2_" = "true")
>> library(oligo)
> Error in omittedSig && (signature[omittedSig] != "missing") :
>  'length(x) = 4 > 1' in coercion to 'logical(1)'
> Error: unable to load R code in package 'oligo'
> 
> is because of a '_R_CHECK_LENGTH_1_LOGIC2_=true' mistake in the
> 'methods' package.  Here's the patch:
> 
> $ svn diff src/library/methods/R/RMethodUtils.R &
> [1] 1062
> Index: src/library/methods/R/RMethodUtils.R
> ===================================================================
> --- src/library/methods/R/RMethodUtils.R (revision 76731)
> +++ src/library/methods/R/RMethodUtils.R (working copy)
> @@ -343,7 +343,7 @@
>              call. = TRUE, domain = NA)
>     }
>     else if(!all(signature[omittedSig] == "missing")) {
> -        omittedSig <- omittedSig && (signature[omittedSig] != "missing")
> +        omittedSig <- omittedSig & (signature[omittedSig] != "missing")
>         .message("Note: ", .renderSignature(f, sig0),
>                  gettextf("expanding the signature to include omitted
> arguments in definition: %s",
>                           paste(sigNames[omittedSig], "=
> \"missing\"",collapse = ", ")))
> [1]+  Done                    svn diff src/library/methods/R/RMethodUtils.R
> 
> Maybe still in time for R 3.6.1?
> 
> /Henrik
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



[Rd] methods package: A _R_CHECK_LENGTH_1_LOGIC2_=true error
peter dalgaard