[R-pkg-devel] Help on Windows CRAN Check

Martin Maechler m@ech|er @end|ng |rom @t@t@m@th@ethz@ch
Fri Mar 6 08:47:59 CET 2020


>>>>> John Lawson 
>>>>>     on Thu, 5 Mar 2020 20:34:00 -0700 writes:

    > I see this error on windows CRAN Check
    > --- failure: the condition has length > 1 ---
    > --- srcref ---
    > :
    > --- package (from environment) ---
    > daewr
    > --- call from context ---
    > ihstep(y, x, m, c)
    > --- call from argument ---
    > if (t1 == "I" & t2 == "(") {
    > iquad = TRUE
    > }

    > t1 and t2 are both characters of length 1, therefore I assume they are
    > scalars. The check on my own computer or R forge gives no errors. When
    > I change if(t1 == "I" & t2 =="(") {iquad=TRUE} to

    > if(t1 == "I" && t2 =="(") {iquad=TRUE}

    > I get the following error when I try the check on my own computer

    > ----------- FAILURE REPORT --------------
    > --- failure: length > 1 in coercion to logical ---
    > --- srcref ---
    > :
    > --- package (from environment) ---
    > daewr
    > --- call from context ---
    > ihstep(y, x, m, c)
    > --- call from argument ---
    > t1 == "I" && t2 == "("
    > --- R stacktrace ---
    > where 1: ihstep(y, x, m, c)
    > where 2: eval(expr, pf)
    > where 3: eval(expr, pf)
    > where 4: withVisible(eval(expr, pf))
    > where 5: evalVis(expr)
    > where 6: capture.output(res <- ihstep(y, x, m, c))
    > where 7: withCallingHandlers(expr, warning = function(w)
    > invokeRestart("muffleWarning"))

    > I am not sure what this means. Using one &, I am able to check and
    > build the package on my computer or R forge but not on CRAN. When
    > using two && I can't check and build on my own computer. Any advice on
    > what to do would be greatly appreciated.

Well, to me it seems clear that your claim

  "t1 and t2 are both characters of length 1, therefore ......"

must be wrong sometimes and that's why you these problems:
In both cases, the respective error is triggered *if and only if*
at least one of t1 or t2 is *not* of length 1.

Martin



More information about the R-package-devel mailing list