From m@ech|er @end|ng |rom @t@t@m@th@ethz@ch  Mon Jun 24 12:04:54 2019
From: m@ech|er @end|ng |rom @t@t@m@th@ethz@ch (Martin Maechler)
Date: Mon, 24 Jun 2019 12:04:54 +0200
Subject: [Rd] methods package: A _R_CHECK_LENGTH_1_LOGIC2_=true error
In-Reply-To: <CAFDcVCTARMfrJRs-KiS5UiSo=SoU8+TgPh_KE+e-zFRR0eCSFQ@mail.gmail.com>
References: <CAFDcVCQOWVr0p2e2HONOy9NvqPdpoAH=HPMOEP65K-N6UjhA2g@mail.gmail.com>
 <67D2E7FE-74E3-4379-B9FB-C4028AB808DF@gmail.com>
 <CAFDcVCTARMfrJRs-KiS5UiSo=SoU8+TgPh_KE+e-zFRR0eCSFQ@mail.gmail.com>
Message-ID: <23824.41030.156424.792062@stat.math.ethz.ch>

>>>>> Henrik Bengtsson via R-core 
>>>>>     on Sun, 23 Jun 2019 11:29:58 -0700 writes:

    > Thank you.
    > To correct myself, I can indeed reproduce this with R --vanilla too.
    > A reproducible example is:

    > $ R --vanilla
    > R version 3.6.0 Patched (2019-05-31 r76629) -- "Planting of a Tree"
    > ...
    >> Sys.setenv("_R_CHECK_LENGTH_1_LOGIC2_" = "true")
    >> loadNamespace("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?

    > /Henrik

Thank you Henrik, for the report, etc, but
hmm... after loading the oligo package, almost 40 (non
base+Recommended) packages have been loaded as well, which hence
need to have been installed before, too .. 
which is not quite a "vanilla repr.ex." in my view

Worse, I cannot reproduce :

    > Sys.setenv("_R_CHECK_LENGTH_1_LOGIC2_" = "true")
    > Sys.getenv("_R_CHECK_LENGTH_1_LOGIC2_")
    [1] "true"
    > debugonce(conformMethod)
    > loadNamespace("oligo")
    <environment: namespace:oligo>
    Warning messages:
    1: multiple methods tables found for ?rowSums? 
    2: multiple methods tables found for ?colSums? 
    3: multiple methods tables found for ?rowMeans? 
    4: multiple methods tables found for ?colMeans? 
    > sessionInfo()
    R Under development (unstable) (2019-06-20 r76729)

(similarly with other versions of R >= 3.6.0).

So, even though R core has fixed this now in the sources, it
would be nice to have an "as simple as possible"  repr.ex. for this.

Martin



    > On Sun, Jun 23, 2019 at 1:54 AM peter dalgaard <pdalgd at gmail.com> wrote:
    >> 
    >> 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
Martin Maechler