From R NEWS (changes in 3.6.0) Experimentally, setting environment variable _R_CHECK_LENGTH_1_LOGIC2_ will lead to warnings (or errors if the variable is set to a ‘true’ value) when && or || encounter and use arguments of length more than one.
On 2020-01-13 11:46 a.m., Therneau, Terry M., Ph.D. via R-devel wrote: > Thanks for the feedback Dirk. I sent my follow-up before I saw it. > > Looking at the source code, it appears that there is no options() call > to turn this on. Nor does "R --help" reveal a command line option. > How then does a user turn this on outside of the R CMD check > envirionment, so as to chase things like this down? > > The fact that 1. renaming my function makes the error go away, 2. my > function is just a wrapper to inherits(), and 3. its a new error in code > that hasn't changed, all point me towards some oddity with the check > function. > > Terry > > > On 1/13/20 10:22 AM, Dirk Eddelbuettel wrote: >> >> On 13 January 2020 at 10:02, Therneau, Terry M., Ph.D. via R-devel wrote: >> | Where can I find out (and replicate) what options as-cran turns on? >> >> See the file src/library/tools/R/check.R in the R sources, and grep for >> as_cran which is the internal variable controlled by the --as-cran option >> >> [...] >> >> | The check log contains multiple instances of the lines below: >> | >> | < Warning message: >> | < In if (ismat(kmat)) { : >> | < the condition has length > 1 and only the first element will be >> used >> | >> | I don't see how the error could arise, but if I know what as-cran is >> doing perhaps I can >> | replicate it. >> >> This was widely discussed on this list and should also be in the NEWS >> file. >> >> The change is about what the message says: the if () tests a scalar >> logical, >> it appears that ismat(kmat) returns more than a scalar. >> >> There has always been an opt-in for this to error -- cf many messages >> by Henrik >> over the years as he tried to convince us all to use it more. >> >> >> Dirk >> > > ______________________________________________ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel ______________________________________________ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel